framework/js/lib/helpers/userOnline.js

14 lines
344 B
JavaScript
Raw Normal View History

2015-12-16 20:43:46 +08:00
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) {
2015-12-16 20:43:46 +08:00
if (user.lastSeenTime() && user.isOnline()) {
return <span className="UserOnline">{icon('fas fa-circle')}</span>;
2015-12-16 20:43:46 +08:00
}
}