@ethora/chat-component-rn 26.8.3 → 26.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +43 -6
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +136 -3
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/helpers/preferencesStorage.js +44 -0
- package/lib/commonjs/helpers/preferencesStorage.js.map +1 -0
- package/lib/commonjs/i18n/strings.js +42 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +13 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +17 -4
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/services/pushRegistration.js +13 -2
- package/lib/commonjs/services/pushRegistration.js.map +1 -1
- package/lib/commonjs/theme/theme.js +28 -4
- package/lib/commonjs/theme/theme.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +47 -10
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +139 -6
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/helpers/preferencesStorage.js +36 -0
- package/lib/module/helpers/preferencesStorage.js.map +1 -0
- package/lib/module/i18n/strings.js +42 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +1 -0
- package/lib/module/main.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +14 -3
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/services/pushRegistration.js +13 -2
- package/lib/module/services/pushRegistration.js.map +1 -1
- package/lib/module/theme/theme.js +28 -3
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/helpers/preferencesStorage.d.ts +11 -0
- package/lib/typescript/helpers/preferencesStorage.d.ts.map +1 -0
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +2 -0
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +12 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushRegistration.d.ts.map +1 -1
- package/lib/typescript/theme/theme.d.ts +17 -3
- package/lib/typescript/theme/theme.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +23 -1
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/MainComponents/ReduxWrapper.tsx +52 -11
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +157 -4
- package/src/helpers/preferencesStorage.ts +40 -0
- package/src/i18n/strings.ts +42 -0
- package/src/main.ts +2 -0
- package/src/roomStore/chatSettingsSlice.ts +24 -2
- package/src/services/pushRegistration.ts +15 -2
- package/src/theme/theme.ts +39 -5
- package/src/types/types.ts +24 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,10 +7,14 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this pr
|
|
|
7
7
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
|
+
- **Settings: Appearance (Light / Dark / System) and a Push notifications switch.** Two new cards on the Settings screen, in the same card style as Manage Data / Visibility. The appearance pick is persisted per device (`@ethora/preferences`, `helpers/preferencesStorage.ts`), folded into `config.dark` by the store (`setThemePreference`; a later `setConfig` from the host keeps the user's choice) so every consumer sees it, and reported to the host through `eventHandlers.onThemeChange(preference, isDark)`. `config.dark` accepts `'system'`, resolved against the OS scheme (`resolveTheme(config, systemDark)` / `isDarkTheme`, falling back to `Appearance.getColorScheme()` for callers without a hook). The push switch (`setPushEnabled`) is wired into the SDK's own token registration: off releases every device-token registration on the backend and keeps the tokens, on registers them again, `registerPushToken` resolves `'disabled'` meanwhile; the host is told through `eventHandlers.onPushNotificationsToggle(enabled)`. `settings.hideAppearance` / `settings.hidePushToggle` hide either card. `ThemePreference`, `setThemePreference`, `setPushEnabled` are exported. Tests in `userSettingsScreen.test.tsx`, `theme.test.ts`, `pushRegistration.test.ts`.
|
|
11
|
+
|
|
10
12
|
- **`registerPushToken` / `unregisterPushToken` / `getRegisteredPushToken` — the host hands the SDK its push token; the SDK does the rest.** Until now the only code that filed a device token was `usePushNotifications`, a Firebase-bound hook that was never mounted and not exported, so a host had no way to register a token through the SDK at all (`instructions.md` claimed otherwise). `registerPushToken(token, { tokenType? })` (`src/services/pushRegistration.ts`) files the token under the signed-in user via `POST /v1/push/subscription/{appId}` — the endpoint the web SDK and the Ethora RN app already use — waits for a session when called before sign-in (`'deferred'`), dedupes the same token + account, honours `pushNotifications.enabled: false` (`'disabled'`), and rejects with `PushRegistrationError` (`status`, `body`) when the backend refuses. On logout `logoutService` releases the registration (`DELETE`, before the access token is cleared) and keeps the token, so the next login of any account is registered again without another call. `unregisterPushToken()` deletes and forgets (`'unregistered' | 'forgotten'`). `detectPushTokenType` tells `expo` / `apns` / `fcm` tokens apart by shape; a backend that predates `tokenType` still gets `apns` / `fcm` tokens through the legacy payload, while `expo` and `apns-voip` are never downgraded into something it could not deliver to. `pushNotifications.apiUrl` keeps the standalone push gateway (`ethora-node-push`) reachable as an explicit legacy mode with its own strict schema (`projectName`, not `projectId`, which the SDK used to send). A device holds up to two tokens — the chat token (`expo` / `fcm` / `apns`) and an optional PushKit `apns-voip` token — registered, released and re-registered together; a rotated token releases the one it replaces. `config.pushNotifications.getPushTokens` is the declarative alternative (called once per login, retried after a back-off on failure), so a host can hand over tokens without wiring `registerPushToken` itself; both can be combined. `PushTokenType`, `PushTokenRegistration`, `PushDeviceType`, `PushSubscriptionPayload`, `RegisterPushTokenOptions/Outcome`, `UnregisterPushTokenOptions/Outcome`, `RegisteredPushToken`, `getRegisteredPushTokens` and `isPushRegistrationError` are exported. The two-slot model and the declarative hook follow `feat/push-token-providers`; the transport differs (main API instead of the gateway, see Fixed). Tests in `pushRegistration.test.ts`.
|
|
11
13
|
|
|
12
14
|
### Fixed
|
|
13
15
|
|
|
16
|
+
- **Android crashed on launch with `NoClassDefFoundError: expo.modules.kotlin.types.AnyTypeProvider` (expo-secure-store).** `expo-secure-store` was pinned to the SDK 54 line (`~15.0.7`, resolved 15.0.8) while the app runs Expo 57. Expo 57 consumes modules as prebuilt AARs, and that AAR was compiled against an `expo-modules-core` where `AnyTypeProvider` still existed, so the crash surfaced at native module registration, not at build time. Bumped to `~57.0.4` (`npx expo install --check` lists the rest of the drift).
|
|
17
|
+
|
|
14
18
|
- **Push registration pointed at a dead endpoint with the wrong payload.** The SDK's only registration path posted `projectId` to `{pushNotifications.apiUrl}/subscriptions` — the standalone gateway, whose Joi schema requires `projectName` and rejects unknown keys, and which the hosted clusters no longer expose at all (`nginx 405`). Every attempt failed and was logged as a success. Registration now goes through the main API by default (see Added); the gateway contract is fixed and kept behind `apiUrl` for self-hosted setups.
|
|
15
19
|
|
|
16
20
|
### Removed
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ReduxWrapper = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
8
9
|
var _reactRedux = require("react-redux");
|
|
9
10
|
var _reactNativeKeyboardController = require("react-native-keyboard-controller");
|
|
10
11
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
@@ -12,6 +13,7 @@ var _native = require("styled-components/native");
|
|
|
12
13
|
var _theme = require("../../theme/theme");
|
|
13
14
|
var _roomStore = require("../../roomStore");
|
|
14
15
|
var _chatSettingsSlice = require("../../roomStore/chatSettingsSlice");
|
|
16
|
+
var _preferencesStorage = require("../../helpers/preferencesStorage");
|
|
15
17
|
var _xmppProvider = require("../../context/xmppProvider");
|
|
16
18
|
var _MessageNotificationContext = require("../../context/MessageNotificationContext");
|
|
17
19
|
var _ToastContext = require("../../context/ToastContext");
|
|
@@ -51,6 +53,42 @@ const ConfigEnabler = ({
|
|
|
51
53
|
}, [config, dispatch]);
|
|
52
54
|
return null;
|
|
53
55
|
};
|
|
56
|
+
const ChatThemeProvider = ({
|
|
57
|
+
config,
|
|
58
|
+
children
|
|
59
|
+
}) => {
|
|
60
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
61
|
+
const storeConfig = (0, _reactRedux.useSelector)(s => s.chatSettingStore.config);
|
|
62
|
+
const preference = (0, _reactRedux.useSelector)(s => s.chatSettingStore.themePreference);
|
|
63
|
+
const systemDark = (0, _reactNative.useColorScheme)() === 'dark';
|
|
64
|
+
const effective = (0, _theme.applyThemePreference)(storeConfig ?? config, preference);
|
|
65
|
+
const theme = (0, _react.useMemo)(() => (0, _theme.resolveTheme)(effective, systemDark), [effective, systemDark]);
|
|
66
|
+
const hydrated = (0, _react.useRef)(false);
|
|
67
|
+
(0, _react.useEffect)(() => {
|
|
68
|
+
if (hydrated.current) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
hydrated.current = true;
|
|
72
|
+
(0, _preferencesStorage.loadPreferences)().then(prefs => {
|
|
73
|
+
if (prefs.theme) {
|
|
74
|
+
dispatch((0, _chatSettingsSlice.setThemePreference)(prefs.theme));
|
|
75
|
+
}
|
|
76
|
+
if (typeof prefs.pushEnabled === 'boolean') {
|
|
77
|
+
dispatch((0, _chatSettingsSlice.setPushEnabled)(prefs.pushEnabled));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}, [dispatch]);
|
|
81
|
+
const onThemeChange = config?.eventHandlers?.onThemeChange;
|
|
82
|
+
(0, _react.useEffect)(() => {
|
|
83
|
+
if (preference && onThemeChange) {
|
|
84
|
+
onThemeChange(preference, theme.dark);
|
|
85
|
+
}
|
|
86
|
+
}, [preference, theme.dark, onThemeChange]);
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_native.ThemeProvider, {
|
|
88
|
+
theme: theme,
|
|
89
|
+
children: children
|
|
90
|
+
});
|
|
91
|
+
};
|
|
54
92
|
const ReduxWrapper = exports.ReduxWrapper = /*#__PURE__*/_react.default.memo(({
|
|
55
93
|
...props
|
|
56
94
|
}) => {
|
|
@@ -69,12 +107,11 @@ const ReduxWrapper = exports.ReduxWrapper = /*#__PURE__*/_react.default.memo(({
|
|
|
69
107
|
// KeyboardAvoidingView under the same flag).
|
|
70
108
|
const ownKeyboardHandling = !memoizedConfig?.disableKeyboardAvoidingView;
|
|
71
109
|
|
|
72
|
-
// Light/dark palette (config.dark + config.darkColors
|
|
73
|
-
// components read it via `({ theme }) => theme.surface`;
|
|
74
|
-
// styles via the `useTheme()` hook.
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
theme: theme,
|
|
110
|
+
// Light/dark palette (config.dark + config.darkColors + the Settings
|
|
111
|
+
// choice). Styled components read it via `({ theme }) => theme.surface`;
|
|
112
|
+
// plain RN styles via the `useTheme()` hook.
|
|
113
|
+
const tree = /*#__PURE__*/(0, _jsxRuntime.jsx)(ChatThemeProvider, {
|
|
114
|
+
config: memoizedConfig,
|
|
78
115
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xmppProvider.XmppProvider, {
|
|
79
116
|
config: memoizedConfig,
|
|
80
117
|
isVisible: props.isVisible,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactRedux","_reactNativeKeyboardController","_reactNativeSafeAreaContext","_native","_theme","_roomStore","_chatSettingsSlice","_xmppProvider","_MessageNotificationContext","_ToastContext","_LoginWrapper","_interopRequireDefault","_installPromiseRejectionTracker","_useChatFonts","_pushRegistration","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","installPromiseRejectionTracker","installPushTokenHook","ConfigEnabler","config","dispatch","useDispatch","React","useEffect","setConfig","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactRedux","_reactNativeKeyboardController","_reactNativeSafeAreaContext","_native","_theme","_roomStore","_chatSettingsSlice","_preferencesStorage","_xmppProvider","_MessageNotificationContext","_ToastContext","_LoginWrapper","_interopRequireDefault","_installPromiseRejectionTracker","_useChatFonts","_pushRegistration","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","installPromiseRejectionTracker","installPushTokenHook","ConfigEnabler","config","dispatch","useDispatch","React","useEffect","setConfig","ChatThemeProvider","children","storeConfig","useSelector","s","chatSettingStore","preference","themePreference","systemDark","useColorScheme","effective","applyThemePreference","theme","useMemo","resolveTheme","hydrated","useRef","current","loadPreferences","then","prefs","setThemePreference","pushEnabled","setPushEnabled","onThemeChange","eventHandlers","dark","jsx","ThemeProvider","ReduxWrapper","exports","memo","props","memoizedConfig","useChatFonts","typography","ownKeyboardHandling","disableKeyboardAvoidingView","tree","XmppProvider","isVisible","ToastProvider","MessageNotificationProvider","jsxs","Provider","store","SafeAreaProvider","KeyboardProvider"],"sourceRoot":"../../../../src","sources":["components/MainComponents/ReduxWrapper.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAA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AA,CAAA2F,gBAAgB;QAAA9C,QAAA,EAAEqC;MAAI,CAAmB,CAAC,GAE3CA;IACD,CACe,CAAC;EAAA,CACX,CAAC;AAEf,CACF,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ var _chatSettingsSlice = require("../../../roomStore/chatSettingsSlice");
|
|
|
14
14
|
var _MODAL_TYPES = require("../../../helpers/constants/MODAL_TYPES");
|
|
15
15
|
var _useChatSettingState = require("../../../hooks/useChatSettingState");
|
|
16
16
|
var _typography = require("../../../helpers/typography");
|
|
17
|
+
var _preferencesStorage = require("../../../helpers/preferencesStorage");
|
|
17
18
|
var _useT = require("../../../i18n/useT");
|
|
18
19
|
var _useTheme = require("../../../hooks/useTheme");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -21,6 +22,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
22
23
|
/** @format */
|
|
23
24
|
|
|
25
|
+
const APPEARANCES = ['light', 'dark', 'system'];
|
|
24
26
|
const UserSettingsModal = ({
|
|
25
27
|
handleCloseModal
|
|
26
28
|
}) => {
|
|
@@ -31,6 +33,17 @@ const UserSettingsModal = ({
|
|
|
31
33
|
} = (0, _useChatSettingState.useChatSettingState)();
|
|
32
34
|
const theme = (0, _useTheme.useTheme)();
|
|
33
35
|
const styles = (0, _react.useMemo)(() => createStyles(theme), [theme]);
|
|
36
|
+
const themePreference = (0, _reactRedux.useSelector)(s => s.chatSettingStore.themePreference);
|
|
37
|
+
const pushEnabled = (0, _reactRedux.useSelector)(s => s.chatSettingStore.pushEnabled);
|
|
38
|
+
|
|
39
|
+
// What the picker shows before the user ever touched it: the host's
|
|
40
|
+
// config.dark, so the selected segment matches what is on screen.
|
|
41
|
+
const appearance = themePreference ?? (config?.dark === 'system' ? 'system' : config?.dark ? 'dark' : 'light');
|
|
42
|
+
const appearanceLabels = (0, _react.useMemo)(() => ({
|
|
43
|
+
light: t('settings.appearance.light'),
|
|
44
|
+
dark: t('settings.appearance.dark'),
|
|
45
|
+
system: t('settings.appearance.system')
|
|
46
|
+
}), [t]);
|
|
34
47
|
const options = (0, _react.useMemo)(() => [{
|
|
35
48
|
label: t('settings.manageData.title'),
|
|
36
49
|
key: _MODAL_TYPES.MODAL_TYPES.MANAGE_DATA
|
|
@@ -41,15 +54,85 @@ const UserSettingsModal = ({
|
|
|
41
54
|
const handleClick = (0, _react.useCallback)(key => {
|
|
42
55
|
dispatch((0, _chatSettingsSlice.setActiveModal)(key));
|
|
43
56
|
}, [dispatch]);
|
|
57
|
+
const handleAppearance = (0, _react.useCallback)(pref => {
|
|
58
|
+
dispatch((0, _chatSettingsSlice.setThemePreference)(pref));
|
|
59
|
+
(0, _preferencesStorage.savePreferences)({
|
|
60
|
+
theme: pref
|
|
61
|
+
});
|
|
62
|
+
}, [dispatch]);
|
|
63
|
+
|
|
64
|
+
// The SDK acts on the flag itself (pushRegistration releases / restores
|
|
65
|
+
// the device-token registrations); the host is told so it can mirror
|
|
66
|
+
// the choice on any native push side it owns.
|
|
67
|
+
const onPushNotificationsToggle = config?.eventHandlers?.onPushNotificationsToggle;
|
|
68
|
+
const handlePush = (0, _react.useCallback)(enabled => {
|
|
69
|
+
dispatch((0, _chatSettingsSlice.setPushEnabled)(enabled));
|
|
70
|
+
(0, _preferencesStorage.savePreferences)({
|
|
71
|
+
pushEnabled: enabled
|
|
72
|
+
});
|
|
73
|
+
if (onPushNotificationsToggle) {
|
|
74
|
+
Promise.resolve(onPushNotificationsToggle(enabled)).catch(err => console.warn('[settings] onPushNotificationsToggle failed', err));
|
|
75
|
+
}
|
|
76
|
+
}, [dispatch, onPushNotificationsToggle]);
|
|
44
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.ModalContainerFullScreen, {
|
|
45
78
|
style: styles.screen,
|
|
46
79
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalHeaderComponent.default, {
|
|
47
80
|
handleCloseModal: handleCloseModal,
|
|
48
81
|
headerTitle: t('settings.menu.title'),
|
|
49
82
|
titleStyle: (0, _typography.chatTextStyle)(config?.typography?.profile?.screenTitle)
|
|
50
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
83
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
51
84
|
style: styles.body,
|
|
52
|
-
children:
|
|
85
|
+
children: [!config?.settings?.hideAppearance ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
86
|
+
style: [styles.card, styles.stackCard],
|
|
87
|
+
testID: "settings-appearance",
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
89
|
+
style: styles.label,
|
|
90
|
+
children: t('settings.appearance.title')
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
92
|
+
style: styles.segmented,
|
|
93
|
+
accessibilityRole: "radiogroup",
|
|
94
|
+
children: APPEARANCES.map(pref => {
|
|
95
|
+
const selected = pref === appearance;
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
97
|
+
testID: `settings-appearance-${pref}`,
|
|
98
|
+
accessibilityRole: "radio",
|
|
99
|
+
accessibilityState: {
|
|
100
|
+
selected
|
|
101
|
+
},
|
|
102
|
+
activeOpacity: 0.7,
|
|
103
|
+
style: [styles.segment, selected && styles.segmentSelected],
|
|
104
|
+
onPress: () => handleAppearance(pref),
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
106
|
+
style: [styles.segmentLabel, selected && styles.segmentLabelSelected],
|
|
107
|
+
children: appearanceLabels[pref]
|
|
108
|
+
})
|
|
109
|
+
}, pref);
|
|
110
|
+
})
|
|
111
|
+
})]
|
|
112
|
+
}) : null, !config?.settings?.hidePushToggle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
113
|
+
style: styles.card,
|
|
114
|
+
testID: "settings-notifications",
|
|
115
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
116
|
+
style: styles.switchText,
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
118
|
+
style: styles.label,
|
|
119
|
+
children: t('settings.notifications.push')
|
|
120
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
121
|
+
style: styles.hint,
|
|
122
|
+
children: t('settings.notifications.pushHint')
|
|
123
|
+
})]
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
125
|
+
testID: "settings-push-switch",
|
|
126
|
+
value: pushEnabled !== false,
|
|
127
|
+
onValueChange: handlePush,
|
|
128
|
+
trackColor: {
|
|
129
|
+
true: theme.primary,
|
|
130
|
+
false: theme.surfaceSecondary
|
|
131
|
+
},
|
|
132
|
+
thumbColor: theme.surface,
|
|
133
|
+
ios_backgroundColor: theme.surfaceSecondary
|
|
134
|
+
})]
|
|
135
|
+
}) : null, options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
53
136
|
testID: `settings-row-${option.key}`,
|
|
54
137
|
activeOpacity: 0.7,
|
|
55
138
|
style: styles.card,
|
|
@@ -63,7 +146,7 @@ const UserSettingsModal = ({
|
|
|
63
146
|
height: 20,
|
|
64
147
|
style: styles.chevron
|
|
65
148
|
})]
|
|
66
|
-
}, option.key))
|
|
149
|
+
}, option.key))]
|
|
67
150
|
})]
|
|
68
151
|
});
|
|
69
152
|
};
|
|
@@ -93,11 +176,61 @@ const createStyles = theme => _reactNative.StyleSheet.create({
|
|
|
93
176
|
shadowRadius: 12,
|
|
94
177
|
elevation: 3
|
|
95
178
|
},
|
|
179
|
+
// Label above the control instead of beside it: three segments do not
|
|
180
|
+
// fit next to a label on narrow phones.
|
|
181
|
+
stackCard: {
|
|
182
|
+
flexDirection: 'column',
|
|
183
|
+
alignItems: 'stretch',
|
|
184
|
+
gap: 14
|
|
185
|
+
},
|
|
96
186
|
label: {
|
|
97
187
|
fontSize: 17,
|
|
98
188
|
fontWeight: '500',
|
|
99
189
|
color: theme.text
|
|
100
190
|
},
|
|
191
|
+
hint: {
|
|
192
|
+
marginTop: 4,
|
|
193
|
+
fontSize: 13,
|
|
194
|
+
lineHeight: 18,
|
|
195
|
+
color: theme.textSecondary
|
|
196
|
+
},
|
|
197
|
+
switchText: {
|
|
198
|
+
flex: 1,
|
|
199
|
+
paddingRight: 16
|
|
200
|
+
},
|
|
201
|
+
segmented: {
|
|
202
|
+
flexDirection: 'row',
|
|
203
|
+
backgroundColor: theme.surfaceSecondary,
|
|
204
|
+
borderRadius: 12,
|
|
205
|
+
padding: 3,
|
|
206
|
+
gap: 3
|
|
207
|
+
},
|
|
208
|
+
segment: {
|
|
209
|
+
flex: 1,
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
justifyContent: 'center',
|
|
212
|
+
paddingVertical: 9,
|
|
213
|
+
borderRadius: 9
|
|
214
|
+
},
|
|
215
|
+
segmentSelected: {
|
|
216
|
+
backgroundColor: theme.surface,
|
|
217
|
+
shadowColor: theme.shadow,
|
|
218
|
+
shadowOffset: {
|
|
219
|
+
width: 0,
|
|
220
|
+
height: 1
|
|
221
|
+
},
|
|
222
|
+
shadowOpacity: 0.08,
|
|
223
|
+
shadowRadius: 3,
|
|
224
|
+
elevation: 2
|
|
225
|
+
},
|
|
226
|
+
segmentLabel: {
|
|
227
|
+
fontSize: 15,
|
|
228
|
+
fontWeight: '500',
|
|
229
|
+
color: theme.textSecondary
|
|
230
|
+
},
|
|
231
|
+
segmentLabelSelected: {
|
|
232
|
+
color: theme.text
|
|
233
|
+
},
|
|
101
234
|
chevron: {
|
|
102
235
|
transform: [{
|
|
103
236
|
rotate: '-90deg'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactRedux","_styledModalComponents","_ModalHeaderComponent","_interopRequireDefault","_icons","_chatSettingsSlice","_MODAL_TYPES","_useChatSettingState","_typography","_useT","_useTheme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","UserSettingsModal","handleCloseModal","useT","dispatch","useDispatch","config","useChatSettingState","theme","useTheme","styles","useMemo","createStyles","options","label","key","MODAL_TYPES","MANAGE_DATA","VISIBILITY","handleClick","useCallback","setActiveModal","jsxs","ModalContainerFullScreen","style","screen","children","jsx","headerTitle","titleStyle","chatTextStyle","typography","profile","screenTitle","View","body","map","option","TouchableOpacity","testID","activeOpacity","card","onPress","Text","ArowDownIcon","color","textSecondary","width","height","chevron","StyleSheet","create","backgroundColor","listBackground","padding","gap","flexDirection","alignItems","justifyContent","surface","borderRadius","paddingHorizontal","paddingVertical","shadowColor","shadow","shadowOffset","shadowOpacity","shadowRadius","elevation","fontSize","fontWeight","text","transform","rotate","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Modals/UserSettingsModal/UserSettingsModal.tsx"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAA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ACDd,IAAI,EAAE;IACJe,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BN,eAAe,EAAE5C,KAAK,CAACmD,OAAO;IAC9BC,YAAY,EAAE,EAAE;IAChBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,WAAW,EAAEvD,KAAK,CAACwD,MAAM;IACzBC,YAAY,EAAE;MAAElB,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCkB,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb,CAAC;EACDtD,KAAK,EAAE;IACLuD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBzB,KAAK,EAAErC,KAAK,CAAC+D;EACf,CAAC;EACDtB,OAAO,EAAE;IACPuB,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3F,OAAA,GAEYiB,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactRedux","_styledModalComponents","_ModalHeaderComponent","_interopRequireDefault","_icons","_chatSettingsSlice","_MODAL_TYPES","_useChatSettingState","_typography","_preferencesStorage","_useT","_useTheme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","APPEARANCES","UserSettingsModal","handleCloseModal","useT","dispatch","useDispatch","config","useChatSettingState","theme","useTheme","styles","useMemo","createStyles","themePreference","useSelector","s","chatSettingStore","pushEnabled","appearance","dark","appearanceLabels","light","system","options","label","key","MODAL_TYPES","MANAGE_DATA","VISIBILITY","handleClick","useCallback","setActiveModal","handleAppearance","pref","setThemePreference","savePreferences","onPushNotificationsToggle","eventHandlers","handlePush","enabled","setPushEnabled","Promise","resolve","catch","err","console","warn","jsxs","ModalContainerFullScreen","style","screen","children","jsx","headerTitle","titleStyle","chatTextStyle","typography","profile","screenTitle","View","body","settings","hideAppearance","card","stackCard","testID","Text","segmented","accessibilityRole","map","selected","TouchableOpacity","accessibilityState","activeOpacity","segment","segmentSelected","onPress","segmentLabel","segmentLabelSelected","hidePushToggle","switchText","hint","Switch","value","onValueChange","trackColor","true","primary","false","surfaceSecondary","thumbColor","surface","ios_backgroundColor","option","ArowDownIcon","color","textSecondary","width","height","chevron","StyleSheet","create","backgroundColor","listBackground","padding","gap","flexDirection","alignItems","justifyContent","borderRadius","paddingHorizontal","paddingVertical","shadowColor","shadow","shadowOffset","shadowOpacity","shadowRadius","elevation","fontSize","fontWeight","text","marginTop","lineHeight","flex","paddingRight","transform","rotate","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Modals/UserSettingsModal/UserSettingsModal.tsx"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AAMA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,SAAA,GAAAb,OAAA;AAAmD,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAK,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAhB,wBAAAgB,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MA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oB,EAAE;IACpBiB,KAAK,EAAEvF,KAAK,CAACgH;EACf,CAAC;EACDrB,OAAO,EAAE;IACP0B,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjJ,OAAA,GAEYkB,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.savePreferences = exports.loadPreferences = exports.clearPreferences = void 0;
|
|
7
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/** @format */
|
|
10
|
+
|
|
11
|
+
const KEY = '@ethora/preferences';
|
|
12
|
+
|
|
13
|
+
/** Small, unencrypted, per-device user preferences set from Settings. */
|
|
14
|
+
|
|
15
|
+
const loadPreferences = async () => {
|
|
16
|
+
try {
|
|
17
|
+
const raw = await _asyncStorage.default.getItem(KEY);
|
|
18
|
+
return raw ? JSON.parse(raw) : {};
|
|
19
|
+
} catch {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.loadPreferences = loadPreferences;
|
|
24
|
+
const savePreferences = async patch => {
|
|
25
|
+
try {
|
|
26
|
+
const current = await loadPreferences();
|
|
27
|
+
await _asyncStorage.default.setItem(KEY, JSON.stringify({
|
|
28
|
+
...current,
|
|
29
|
+
...patch
|
|
30
|
+
}));
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.warn('[preferences] save failed', error);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.savePreferences = savePreferences;
|
|
36
|
+
const clearPreferences = async () => {
|
|
37
|
+
try {
|
|
38
|
+
await _asyncStorage.default.removeItem(KEY);
|
|
39
|
+
} catch {
|
|
40
|
+
/* ignore */
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.clearPreferences = clearPreferences;
|
|
44
|
+
//# sourceMappingURL=preferencesStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_asyncStorage","_interopRequireDefault","require","e","__esModule","default","KEY","loadPreferences","raw","AsyncStorage","getItem","JSON","parse","exports","savePreferences","patch","current","setItem","stringify","error","console","warn","clearPreferences","removeItem"],"sourceRoot":"../../../src","sources":["helpers/preferencesStorage.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAqE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAFrE;;AAKA,MAAMG,GAAG,GAAG,qBAAqB;;AAEjC;;AAMO,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAAwC;EACrE,IAAI;IACF,MAAMC,GAAG,GAAG,MAAMC,qBAAY,CAACC,OAAO,CAACJ,GAAG,CAAC;IAC3C,OAAOE,GAAG,GAAIG,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC,GAAyB,CAAC,CAAC;EAC1D,CAAC,CAAC,MAAM;IACN,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAACK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEK,MAAMO,eAAe,GAAG,MAC7BC,KAAwB,IACN;EAClB,IAAI;IACF,MAAMC,OAAO,GAAG,MAAMT,eAAe,CAAC,CAAC;IACvC,MAAME,qBAAY,CAACQ,OAAO,CAACX,GAAG,EAAEK,IAAI,CAACO,SAAS,CAAC;MAAE,GAAGF,OAAO;MAAE,GAAGD;IAAM,CAAC,CAAC,CAAC;EAC3E,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdC,OAAO,CAACC,IAAI,CAAC,2BAA2B,EAAEF,KAAK,CAAC;EAClD;AACF,CAAC;AAACN,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAEK,MAAMQ,gBAAgB,GAAG,MAAAA,CAAA,KAA2B;EACzD,IAAI;IACF,MAAMb,qBAAY,CAACc,UAAU,CAACjB,GAAG,CAAC;EACpC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAACO,OAAA,CAAAS,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -243,6 +243,13 @@ const en = {
|
|
|
243
243
|
'settings.blockedUsers.label': 'Blocked Users',
|
|
244
244
|
'settings.blockedUsers.description': 'Users you have blocked cannot send you messages or see when you are online.',
|
|
245
245
|
'settings.blockedUsers.emptyState': "You haven't blocked anyone yet.",
|
|
246
|
+
'settings.appearance.title': 'Appearance',
|
|
247
|
+
'settings.appearance.light': 'Light',
|
|
248
|
+
'settings.appearance.dark': 'Dark',
|
|
249
|
+
'settings.appearance.system': 'System',
|
|
250
|
+
'settings.notifications.title': 'Notifications',
|
|
251
|
+
'settings.notifications.push': 'Push notifications',
|
|
252
|
+
'settings.notifications.pushHint': 'New messages and calls wake this device even when the app is closed.',
|
|
246
253
|
'settings.visibility.title': 'Visibility',
|
|
247
254
|
'settings.visibility.profileLabel': 'Profile Visibility',
|
|
248
255
|
'settings.visibility.open': 'Open (default)',
|
|
@@ -493,6 +500,13 @@ const fr = {
|
|
|
493
500
|
'settings.blockedUsers.label': 'Utilisateurs bloqués',
|
|
494
501
|
'settings.blockedUsers.description': "Les utilisateurs que vous avez bloqués ne peuvent pas vous envoyer de messages ni voir quand vous êtes en ligne.",
|
|
495
502
|
'settings.blockedUsers.emptyState': "Vous n'avez encore bloqué personne.",
|
|
503
|
+
'settings.appearance.title': 'Apparence',
|
|
504
|
+
'settings.appearance.light': 'Clair',
|
|
505
|
+
'settings.appearance.dark': 'Sombre',
|
|
506
|
+
'settings.appearance.system': 'Système',
|
|
507
|
+
'settings.notifications.title': 'Notifications',
|
|
508
|
+
'settings.notifications.push': 'Notifications push',
|
|
509
|
+
'settings.notifications.pushHint': 'Les nouveaux messages et appels réveillent cet appareil même quand l\'application est fermée.',
|
|
496
510
|
'settings.visibility.title': 'Visibilité',
|
|
497
511
|
'settings.visibility.profileLabel': 'Visibilité du profil',
|
|
498
512
|
'settings.visibility.open': 'Ouvert (par défaut)',
|
|
@@ -743,6 +757,13 @@ const es = {
|
|
|
743
757
|
'settings.blockedUsers.label': 'Usuarios bloqueados',
|
|
744
758
|
'settings.blockedUsers.description': 'Los usuarios que hayas bloqueado no podrán enviarte mensajes ni ver cuándo estás en línea.',
|
|
745
759
|
'settings.blockedUsers.emptyState': 'Todavía no has bloqueado a nadie.',
|
|
760
|
+
'settings.appearance.title': 'Apariencia',
|
|
761
|
+
'settings.appearance.light': 'Claro',
|
|
762
|
+
'settings.appearance.dark': 'Oscuro',
|
|
763
|
+
'settings.appearance.system': 'Sistema',
|
|
764
|
+
'settings.notifications.title': 'Notificaciones',
|
|
765
|
+
'settings.notifications.push': 'Notificaciones push',
|
|
766
|
+
'settings.notifications.pushHint': 'Los mensajes y llamadas nuevos despiertan este dispositivo incluso con la aplicación cerrada.',
|
|
746
767
|
'settings.visibility.title': 'Visibilidad',
|
|
747
768
|
'settings.visibility.profileLabel': 'Visibilidad del perfil',
|
|
748
769
|
'settings.visibility.open': 'Abierto (predeterminado)',
|
|
@@ -993,6 +1014,13 @@ const pt = {
|
|
|
993
1014
|
'settings.blockedUsers.label': 'Utilizadores bloqueados',
|
|
994
1015
|
'settings.blockedUsers.description': 'Os utilizadores que bloqueou não lhe podem enviar mensagens nem ver quando está online.',
|
|
995
1016
|
'settings.blockedUsers.emptyState': 'Ainda não bloqueou ninguém.',
|
|
1017
|
+
'settings.appearance.title': 'Aparência',
|
|
1018
|
+
'settings.appearance.light': 'Claro',
|
|
1019
|
+
'settings.appearance.dark': 'Escuro',
|
|
1020
|
+
'settings.appearance.system': 'Sistema',
|
|
1021
|
+
'settings.notifications.title': 'Notificações',
|
|
1022
|
+
'settings.notifications.push': 'Notificações push',
|
|
1023
|
+
'settings.notifications.pushHint': 'Novas mensagens e chamadas acordam este dispositivo mesmo com o aplicativo fechado.',
|
|
996
1024
|
'settings.visibility.title': 'Visibilidade',
|
|
997
1025
|
'settings.visibility.profileLabel': 'Visibilidade do perfil',
|
|
998
1026
|
'settings.visibility.open': 'Aberto (predefinição)',
|
|
@@ -1243,6 +1271,13 @@ const ht = {
|
|
|
1243
1271
|
'settings.blockedUsers.label': 'Itilizatè bloke',
|
|
1244
1272
|
'settings.blockedUsers.description': 'Itilizatè ou bloke yo pa ka voye mesaj ba ou ni wè lè ou an liy.',
|
|
1245
1273
|
'settings.blockedUsers.emptyState': 'Ou poko bloke pèsonn.',
|
|
1274
|
+
'settings.appearance.title': 'Aparans',
|
|
1275
|
+
'settings.appearance.light': 'Klè',
|
|
1276
|
+
'settings.appearance.dark': 'Fonse',
|
|
1277
|
+
'settings.appearance.system': 'Sistèm',
|
|
1278
|
+
'settings.notifications.title': 'Notifikasyon',
|
|
1279
|
+
'settings.notifications.push': 'Notifikasyon push',
|
|
1280
|
+
'settings.notifications.pushHint': 'Nouvo mesaj ak apèl reveye aparèy sa a menm lè aplikasyon an fèmen.',
|
|
1246
1281
|
'settings.visibility.title': 'Vizibilite',
|
|
1247
1282
|
'settings.visibility.profileLabel': 'Vizibilite pwofil la',
|
|
1248
1283
|
'settings.visibility.open': 'Louvri (default)',
|
|
@@ -1493,6 +1528,13 @@ const zh = {
|
|
|
1493
1528
|
'settings.blockedUsers.label': '已屏蔽用户',
|
|
1494
1529
|
'settings.blockedUsers.description': '被您屏蔽的用户无法向您发送消息,也无法看到您何时在线。',
|
|
1495
1530
|
'settings.blockedUsers.emptyState': '您还没有屏蔽任何人。',
|
|
1531
|
+
'settings.appearance.title': '外观',
|
|
1532
|
+
'settings.appearance.light': '浅色',
|
|
1533
|
+
'settings.appearance.dark': '深色',
|
|
1534
|
+
'settings.appearance.system': '跟随系统',
|
|
1535
|
+
'settings.notifications.title': '通知',
|
|
1536
|
+
'settings.notifications.push': '推送通知',
|
|
1537
|
+
'settings.notifications.pushHint': '即使应用已关闭,新消息和来电也会唤醒此设备。',
|
|
1496
1538
|
'settings.visibility.title': '可见性',
|
|
1497
1539
|
'settings.visibility.profileLabel': '资料可见性',
|
|
1498
1540
|
'settings.visibility.open': '公开(默认)',
|