Skip to content

Commit

Permalink
feat: Update notification settings layout and translations
Browse files Browse the repository at this point in the history
This commit updates the layout and translations for the notification settings page. It includes changes to the language files to add translations for the new settings tabs, as well as updates to the layout component to reflect the new tab structure. These changes improve the user experience and make the code more maintainable.

Refactor the code to enhance maintainability and readability.
  • Loading branch information
tikazyq committed Jul 18, 2024
1 parent f6abba7 commit 10ba905
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
9 changes: 6 additions & 3 deletions src/i18n/lang/en/layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ const layouts: LLayouts = {
},
notifications: {
title: 'Notifications',
tabs: {
settings: 'Settings',
templates: 'Templates',
settings: {
title: 'Settings',
tabs: {
overview: 'Overview',
template: 'Template',
},
},
},
gits: {
Expand Down
11 changes: 7 additions & 4 deletions src/i18n/lang/zh/layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ const layouts: LLayouts = {
},
},
notifications: {
title: '通知',
tabs: {
settings: '设置',
templates: '模板',
title: '消息通知',
settings: {
title: '通知配置',
tabs: {
overview: '概览',
template: '模板',
},
},
},
gits: {
Expand Down
9 changes: 6 additions & 3 deletions src/interfaces/i18n/layouts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ export declare global {
};
notification: {
title: string;
tabs: {
settings: string;
templates: string;
settings: {
title: string;
tabs: {
overview: string;
template: string;
};
};
};
gits: {
Expand Down
12 changes: 9 additions & 3 deletions src/router/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,24 @@ const t = translate;
const endpoint = 'notifications';

export default [
{
path: endpoint,
title: t('layouts.routes.notifications.title'),
icon: ['fa', 'envelope'],
redirect: to => {
return { path: to.path + '/settings' };
},
},
{
name: 'NotificationSettingList',
path: `${endpoint}/settings`,
title: t('layouts.routes.notifications.settings.title'),
icon: ['fa', 'envelope'],
icon: ['fa', 'cog'],
component: async () => ClNotificationSettingList,
},
{
name: 'NotificationSettingDetail',
path: `${endpoint}/settings/:id`,
title: t('layouts.routes.notifications.settings.title'),
icon: ['fa', 'envelope'],
redirect: to => {
return { path: to.path + '/' + TAB_NAME_OVERVIEW };
},
Expand Down

0 comments on commit 10ba905

Please sign in to comment.