0.0.18 • Published 6 years ago

react-last-status v0.0.18

Weekly downloads
78
License
-
Repository
github
Last release
6 years ago

Hit Star on GitHub

React Last Status Component

React component that shows the last status of user. Add your own last seen status to your project.

Auto Refresh

The react-last-status makes auto refreshes automatically each 15.000ms.

Demo

Lorem Ipsum...

Usage

Install package:

npm install --save react-last-status

Import component:

import LastStatus from 'react-last-status';

Add component with respective props:

<LastStatus timestamp={timestamp}/>

Props

propdescription
nowoutput personalization
sameDayoutput personalization
lastDayoutput personalization
lastWeekoutput personalization
sameElseoutput personalization
timestamptimestamp of last status
localelanguage
nowLimiartime elapsed to consider online

Output Personalization

elapsed timestatus output examplepropsdefault
max last nowLimiar msonlinenow[online]
max same daytoday at 00:00sameDay[today] [at] HH:mm
max 1 day agoyesterday at 00:00lastDay[yesterday] [at] HH:mm
max 1 week agosunday at 00:00lastWeekdddd [at] HH:mm
before01/01/2018 at 00:00sameElseL [at] HH:mm
<LastStatus
	timestamp={timestamp}
	now={'[I am alive]'}
	sameDay={'[last seen today at] HH:mm'}
	lastDay={'[last seen yesterday at] HH:mm'}
	lastWeek={'[last seen] dddd [at] HH:mm'}
	sameElse={'[last seen] L [at] HH:mm'}/>

Escaping characters

To escape characters in format strings, you can wrap the characters in square brackets.

'[today at] HH:mm' //'today at 00:00'

Languages

Set the language of component with locale prop.

<LastStatus locale={'pt-BR'}/>
localelanguage
en (default)English (USA)
pt-BRPortuguese (Brazil)
0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago