mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
import icon from 'flarum/helpers/icon';
|
|
|
|
/**
|
|
* The `useronline` helper displays a green circle if the user is online
|
|
*
|
|
* @param {User} user
|
|
* @return {Object}
|
|
*/
|
|
export default function userOnline(user) {
|
|
if (user.lastSeenTime() && user.isOnline()) {
|
|
return <span className="UserOnline">{icon('circle')}</span>;
|
|
}
|
|
}
|