Added user online indicator to post

This commit is contained in:
Peter Mein
2015-12-16 13:43:46 +01:00
parent 32601d2c98
commit e55b7a14e5
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,13 @@
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>;
}
}