mattermost-mobile/app/screens/settings/config.ts
Avinash Lingaloo 431406f09b
MM-45221 - Gekidou Settings fixes - part 1 (#6472)
* modifying setting option

* navigates to email screen

* UI construction [in progress]

* hooking up withObservables

* email settings - need to save now

* adding a bit of paddings

* setting initial value

* Update notification_email.tsx

* UI Polish - main setting screen

* UI Polish - Mention

* UI Polish - Notification main screen

* code clean up

* code clean up

* UI Polish Notification

* UI Polish

* code clean up

* UI Polish - OOO

* fix observable for email interval

* fix ooo

* fix ooo

* added setting_row_label component

* further clean up

* UI Polish - Display - [ IN PROGRESS ]

* UI Polish - Display - [ IN PROGRESS ]

* UI Polish - Timezone Select [ IN PROGRESS ]

* Update index.test.tsx.snap

* Update app/screens/settings/notification_email/notification_email.tsx

Co-authored-by: Daniel Espino García <larkox@gmail.com>

* refactor after review

* update option_item so that action can accept type React.Dispatch<React.SetStateAction

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2022-07-15 13:32:25 +04:00

102 lines
3 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {t} from '@i18n';
import {typography} from '@utils/typography';
import type {IntlShape} from 'react-intl';
export const getSaveButton = (buttonId: string, intl: IntlShape, color: string) => ({
color,
enabled: false,
id: buttonId,
showAsAction: 'always' as const,
testID: 'notification_settings.mentions.save.button',
text: intl.formatMessage({id: 'settings.save', defaultMessage: 'Save'}),
...typography('Body', 100, 'SemiBold'),
});
export const SettingOptionConfig = {
notification: {
defaultMessage: 'Notifications',
i18nId: t('general_settings.notifications'),
iconName: 'bell-outline',
testID: 'general_settings.notifications',
},
display: {
defaultMessage: 'Display',
i18nId: t('general_settings.display'),
iconName: 'layers-outline',
testID: 'general_settings.display',
},
advanced_settings: {
defaultMessage: 'Advanced Settings',
i18nId: t('general_settings.advanced_settings'),
iconName: 'tune',
testID: 'general_settings.advanced',
},
about: {
defaultMessage: 'About {appTitle}',
i18nId: t('general_settings.about'),
iconName: 'information-outline',
testID: 'general_settings.about',
},
help: {
defaultMessage: 'Help',
i18nId: t('general_settings.help'),
testID: 'general_settings.help',
showArrow: false,
},
};
export const NotificationsOptionConfig = {
mentions: {
iconName: 'at',
testID: 'notification_settings.mentions_replies',
},
push_notification: {
defaultMessage: 'Push Notifications',
i18nId: t('notification_settings.mobile'),
iconName: 'cellphone',
testID: 'notification_settings.push_notification',
},
email: {
defaultMessage: 'Email',
i18nId: t('notification_settings.email'),
iconName: 'email-outline',
testID: 'notification_settings.email',
},
automatic_dm_replies: {
defaultMessage: 'Automatic replies',
i18nId: t('notification_settings.ooo_auto_responder'),
iconName: 'reply-outline',
testID: 'notification_settings.automatic_dm_replies',
},
};
export const DisplayOptionConfig = {
clock: {
defaultMessage: 'Clock Display',
i18nId: t('mobile.display_settings.clockDisplay'),
iconName: 'clock-outline',
testID: 'display_settings.clock',
},
theme: {
defaultMessage: 'Theme',
i18nId: t('mobile.display_settings.theme'),
iconName: 'palette-outline',
testID: 'display_settings.theme',
},
timezone: {
defaultMessage: 'Timezone',
i18nId: t('mobile.display_settings.timezone'),
iconName: 'globe',
testID: 'display_settings.timezone',
},
};
export default {
...SettingOptionConfig,
...NotificationsOptionConfig,
...DisplayOptionConfig,
};