mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 15:19:56 +08:00
Massive JavaScript cleanup
- Use JSX for templates - Docblock/comment everything - Mostly passes ESLint (still some work to do) - Lots of renaming, refactoring, etc. CSS hasn't been updated yet.
This commit is contained in:
@ -1,5 +1,12 @@
|
||||
/**
|
||||
* The `username` helper displays a user's username in a <span class="username">
|
||||
* tag. If the user doesn't exist, the username will be displayed as [deleted].
|
||||
*
|
||||
* @param {User} user
|
||||
* @return {Object}
|
||||
*/
|
||||
export default function username(user) {
|
||||
var username = (user && user.username()) || '[deleted]';
|
||||
const name = (user && user.username()) || '[deleted]';
|
||||
|
||||
return m('span.username', username);
|
||||
return <span className="username">{name}</span>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user