Skip to content

Commit

Permalink
chore: major frontend JS cleanup (#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat authored May 7, 2023
1 parent dcd15ce commit b677316
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ app.initializers.add('flarum-suspend', () => {
if (user.canSuspend()) {
items.add(
'suspend',
Button.component(
{
icon: 'fas fa-ban',
onclick: () => app.modal.show(SuspendUserModal, { user }),
},
app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')
)
<Button icon="fas fa-ban" onclick={() => app.modal.show(SuspendUserModal, { user })}>
{app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')}
</Button>
);
}
});
Expand All @@ -37,11 +33,8 @@ app.initializers.add('flarum-suspend', () => {
if (new Date() < until) {
items.add(
'suspended',
Badge.component({
icon: 'fas fa-ban',
type: 'suspended',
label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip'),
})
<Badge icon="fas fa-ban" type="suspended" label={app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')} />,
100
);
}
});
Expand Down

0 comments on commit b677316

Please sign in to comment.