mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
chore: add priorities to profile settings page (#3657)
To give extensions more flexibility
This commit is contained in:
@@ -40,14 +40,15 @@ export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPage
|
|||||||
settingsItems() {
|
settingsItems() {
|
||||||
const items = new ItemList<Mithril.Children>();
|
const items = new ItemList<Mithril.Children>();
|
||||||
|
|
||||||
['account', 'notifications', 'privacy'].forEach((section) => {
|
['account', 'notifications', 'privacy'].forEach((section, index) => {
|
||||||
const sectionItems = `${section}Items` as 'accountItems' | 'notificationsItems' | 'privacyItems';
|
const sectionItems = `${section}Items` as 'accountItems' | 'notificationsItems' | 'privacyItems';
|
||||||
|
|
||||||
items.add(
|
items.add(
|
||||||
section,
|
section,
|
||||||
<FieldSet className={`Settings-${section}`} label={app.translator.trans(`core.forum.settings.${section}_heading`)}>
|
<FieldSet className={`Settings-${section}`} label={app.translator.trans(`core.forum.settings.${section}_heading`)}>
|
||||||
{this[sectionItems]().toArray()}
|
{this[sectionItems]().toArray()}
|
||||||
</FieldSet>
|
</FieldSet>,
|
||||||
|
100 - index * 10
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,14 +65,16 @@ export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPage
|
|||||||
'changePassword',
|
'changePassword',
|
||||||
<Button className="Button" onclick={() => app.modal.show(ChangePasswordModal)}>
|
<Button className="Button" onclick={() => app.modal.show(ChangePasswordModal)}>
|
||||||
{app.translator.trans('core.forum.settings.change_password_button')}
|
{app.translator.trans('core.forum.settings.change_password_button')}
|
||||||
</Button>
|
</Button>,
|
||||||
|
100
|
||||||
);
|
);
|
||||||
|
|
||||||
items.add(
|
items.add(
|
||||||
'changeEmail',
|
'changeEmail',
|
||||||
<Button className="Button" onclick={() => app.modal.show(ChangeEmailModal)}>
|
<Button className="Button" onclick={() => app.modal.show(ChangeEmailModal)}>
|
||||||
{app.translator.trans('core.forum.settings.change_email_button')}
|
{app.translator.trans('core.forum.settings.change_email_button')}
|
||||||
</Button>
|
</Button>,
|
||||||
|
90
|
||||||
);
|
);
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
@@ -83,7 +86,7 @@ export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPage
|
|||||||
notificationsItems() {
|
notificationsItems() {
|
||||||
const items = new ItemList<Mithril.Children>();
|
const items = new ItemList<Mithril.Children>();
|
||||||
|
|
||||||
items.add('notificationGrid', <NotificationGrid user={this.user} />);
|
items.add('notificationGrid', <NotificationGrid user={this.user} />, 100);
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
@@ -109,7 +112,8 @@ export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPage
|
|||||||
loading={this.discloseOnlineLoading}
|
loading={this.discloseOnlineLoading}
|
||||||
>
|
>
|
||||||
{app.translator.trans('core.forum.settings.privacy_disclose_online_label')}
|
{app.translator.trans('core.forum.settings.privacy_disclose_online_label')}
|
||||||
</Switch>
|
</Switch>,
|
||||||
|
100
|
||||||
);
|
);
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
Reference in New Issue
Block a user