mirror of
https://github.com/flarum/framework.git
synced 2025-02-23 05:54:10 +08:00
Simplify notification markup
This commit is contained in:
parent
b3aa0298d5
commit
2f8a449b74
@ -19,18 +19,21 @@ export default class Notification extends Component {
|
|||||||
const href = this.href();
|
const href = this.href();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
|
<a className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
|
||||||
onclick={this.markAsRead.bind(this)}>
|
href={href}
|
||||||
<a href={href} config={href.indexOf('://') === -1 ? m.route : undefined}>
|
config={function(element, isInitialized) {
|
||||||
{avatar(notification.sender())}
|
if (href.indexOf('://') === -1) m.route.apply(this, arguments);
|
||||||
{icon(this.icon(), {className: 'Notification-icon'})}
|
|
||||||
<span className="Notification-content">{this.content()}</span>
|
if (!isInitialized) $(element).click(this.markAsRead.bind(this));
|
||||||
{humanTime(notification.time())}
|
}}>
|
||||||
<div className="Notification-excerpt">
|
{avatar(notification.sender())}
|
||||||
{this.excerpt()}
|
{icon(this.icon(), {className: 'Notification-icon'})}
|
||||||
</div>
|
<span className="Notification-content">{this.content()}</span>
|
||||||
</a>
|
{humanTime(notification.time())}
|
||||||
</div>
|
<div className="Notification-excerpt">
|
||||||
|
{this.excerpt()}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user