mattermost-mobile-upstream/app/screens/settings/config.ts
Elias Nahum b6fc85385e
Migrate from RNN to Expo router (#9402)
* Expo-Router partial migration

* Full migration to ExpoRouter

* i18n

* add tests

* Merge branch 'main' into expo-router

* align package-lock.json

* i18n

* feedback review

* feedback review

* android 16kb patch

* Refactored emoji picker keyboard using a state machine

* set android launch_screen in drawables instead of layout

* no conditional hooks

* remove duplicate call in test

* address feedback

* fix tests and address more feedback

* small corrections

* small corrections

* small corrections

* fix draft test

* fix draft test 2

* remove navigateToScreen in draff test

* fix nit in draft test

* remove doc file

* Feedback review

* fix snapshots

* improve test coverage

* fix i18n

* Upgrade t o RN 0.83, other dependencies and new architecture (#9737)

* library hardware-keyboard android new arch support fix

* library rnshare android new arch support fix

* library rnutils android new arch support fix

* library secure-pdf-viewer add new arch support

* Enable new arch on iOS and Android

* update emm and network client with new-arch

* update intune to use new-arch

* performance improvements

* fix tests

* fixes post input on new-arch

* fix android emoji picker

* remove doc

* run tests in parallel

* upgrade to React Native 0.83.9, Expo 55, React 19, and New Architecture

Bumps core dependencies to their latest versions:
- React Native 0.77.3 → 0.83.9 (New Architecture enabled)
- React 18.3.1 → 19.2.5
- Expo SDK 52 → 55
- TypeScript 5.8.3 → 6.0.3
- Node.js 22.16.0 → 24.15.0
- react-native-reanimated 3.17.3 → 4.3.0
- Various other dependency upgrades

Migrates iOS AppDelegate from Objective-C to Swift, updates Android
build tooling and Gradle wrapper, refreshes all patches and font
assets, and adapts app code, tests, and CI workflows throughout for
API changes introduced by these upgrades.

* remove unecessary dismissKeyboard in notifications

* feedback review

* update intune to use new-arch

* update @mattermost deps

* missing i18n string

* additional fixes

* update fastlane
2026-05-13 17:44:55 +08:00

195 lines
5.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {defineMessages, type IntlShape} from 'react-intl';
import {typography} from '@utils/typography';
import type {CompassIconName} from '@components/compass_icon';
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'),
});
type SettingConfigDetails = {
defaultMessage?: string;
id?: string;
icon?: CompassIconName;
testID?: string;
}
const messages = defineMessages({
download_logs: {
defaultMessage: 'Download app logs',
id: 'general_settings.download_logs',
},
report_problem: {
defaultMessage: 'Report a problem',
id: 'general_settings.report_problem',
},
notifications: {
defaultMessage: 'Notifications',
id: 'general_settings.notifications',
},
display: {
defaultMessage: 'Display',
id: 'general_settings.display',
},
advanced_settings: {
defaultMessage: 'Advanced Settings',
id: 'general_settings.advanced_settings',
},
about: {
defaultMessage: 'About {appTitle}',
id: 'general_settings.about',
},
help: {
defaultMessage: 'Help',
id: 'general_settings.help',
},
push_notifications: {
defaultMessage: 'Push Notifications',
id: 'notification_settings.mobile',
},
call_notifications: {
defaultMessage: 'Call Notifications',
id: 'notification_settings.calls',
},
email: {
defaultMessage: 'Email',
id: 'notification_settings.email',
},
automatic_replies: {
defaultMessage: 'Automatic replies',
id: 'notification_settings.ooo_auto_responder',
},
clock_display: {
defaultMessage: 'Clock Display',
id: 'mobile.display_settings.clockDisplay',
},
crt: {
defaultMessage: 'Collapsed Reply Threads',
id: 'mobile.display_settings.crt',
},
theme: {
defaultMessage: 'Theme',
id: 'mobile.display_settings.theme',
},
timezone: {
defaultMessage: 'Timezone',
id: 'mobile.display_settings.timezone',
},
});
export const SettingOptionConfig: Record<string, SettingConfigDetails> = {
notification: {
defaultMessage: messages.notifications.defaultMessage,
id: messages.notifications.id,
icon: 'bell-outline',
testID: messages.notifications.id,
},
display: {
defaultMessage: messages.display.defaultMessage,
id: messages.display.id,
icon: 'layers-outline',
testID: messages.display.id,
},
advanced_settings: {
defaultMessage: messages.advanced_settings.defaultMessage,
id: messages.advanced_settings.id,
icon: 'tune',
testID: messages.advanced_settings.id,
},
about: {
defaultMessage: messages.about.defaultMessage,
id: messages.about.id,
icon: 'information-outline',
testID: messages.about.id,
},
help: {
defaultMessage: messages.help.defaultMessage,
id: messages.help.id,
testID: messages.help.id,
},
report_problem: {
defaultMessage: messages.report_problem.defaultMessage,
id: messages.report_problem.id,
testID: messages.report_problem.id,
},
download_logs: {
defaultMessage: messages.download_logs.defaultMessage,
id: messages.download_logs.id,
testID: messages.download_logs.id,
},
};
export const NotificationsOptionConfig: Record<string, SettingConfigDetails> = {
mentions: {
icon: 'at',
testID: 'notification_settings.mentions_replies',
},
push_notification: {
defaultMessage: messages.push_notifications.defaultMessage,
id: messages.push_notifications.id,
icon: 'cellphone',
testID: messages.push_notifications.id,
},
call_notification: {
defaultMessage: messages.call_notifications.defaultMessage,
id: messages.call_notifications.id,
icon: 'phone-in-talk',
testID: messages.call_notifications.id,
},
email: {
defaultMessage: messages.email.defaultMessage,
id: messages.email.id,
icon: 'email-outline',
testID: messages.email.id,
},
automatic_dm_replies: {
defaultMessage: messages.automatic_replies.defaultMessage,
id: messages.automatic_replies.id,
icon: 'reply-outline',
testID: messages.automatic_replies.id,
},
};
export const DisplayOptionConfig: Record<string, SettingConfigDetails> = {
clock: {
defaultMessage: messages.clock_display.defaultMessage,
id: messages.clock_display.id,
icon: 'clock-outline',
testID: messages.clock_display.id,
},
crt: {
defaultMessage: messages.crt.defaultMessage,
id: messages.crt.id,
icon: 'message-text-outline',
testID: messages.crt.id,
},
theme: {
defaultMessage: messages.theme.defaultMessage,
id: messages.theme.id,
icon: 'palette-outline',
testID: messages.theme.id,
},
timezone: {
defaultMessage: messages.timezone.defaultMessage,
id: messages.timezone.id,
icon: 'globe',
testID: messages.timezone.id,
},
};
export default {
...SettingOptionConfig,
...NotificationsOptionConfig,
...DisplayOptionConfig,
};