@umituz/react-native-settings 4.16.13 → 4.16.14
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/package.json +27 -58
- package/src/__tests__/integration.test.tsx +1 -1
- package/src/__tests__/performance.test.tsx +1 -1
- package/src/__tests__/setup.ts +2 -2
- package/src/presentation/components/DevSettingsSection.tsx +1 -1
- package/src/presentation/components/SettingItem.tsx +1 -1
- package/src/presentation/components/SettingsErrorBoundary.tsx +2 -2
- package/src/presentation/components/SettingsFooter.tsx +6 -5
- package/src/presentation/components/SettingsSection.tsx +1 -1
- package/src/presentation/components/UserProfileHeader.tsx +2 -2
- package/src/presentation/components/__tests__/SettingItem.test.tsx +1 -1
- package/src/presentation/components/__tests__/SettingsErrorBoundary.test.tsx +2 -2
- package/src/presentation/navigation/SettingsStackNavigator.tsx +1 -1
- package/src/presentation/screens/SettingsScreen.tsx +1 -1
- package/src/presentation/screens/__tests__/SettingsScreen.test.tsx +1 -1
- package/src/presentation/screens/components/SettingsContent.tsx +14 -2
- package/src/presentation/screens/components/SettingsHeader.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.14",
|
|
4
4
|
"description": "Settings management for React Native apps - user preferences, theme, language, notifications",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -29,72 +29,41 @@
|
|
|
29
29
|
"@expo/vector-icons": ">=14.0.0",
|
|
30
30
|
"@react-navigation/native": ">=6.0.0",
|
|
31
31
|
"@react-navigation/stack": ">=6.0.0",
|
|
32
|
-
"@umituz/react-native-about": "
|
|
33
|
-
"@umituz/react-native-appearance": "
|
|
34
|
-
"@umituz/react-native-avatar": "
|
|
35
|
-
"@umituz/react-native-
|
|
36
|
-
"@umituz/react-native-
|
|
37
|
-
"@umituz/react-native-
|
|
38
|
-
"@umituz/react-native-
|
|
39
|
-
"@umituz/react-native-
|
|
40
|
-
"@umituz/react-native-
|
|
41
|
-
"@umituz/react-native-
|
|
42
|
-
"@umituz/react-native-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"@umituz/react-native-notifications": "*",
|
|
48
|
-
"@umituz/react-native-onboarding": "*",
|
|
49
|
-
"@umituz/react-native-rating": "*",
|
|
50
|
-
"@umituz/react-native-storage": "*",
|
|
51
|
-
"lucide-react-native": "*",
|
|
52
|
-
"react": ">=18.2.0",
|
|
53
|
-
"react-native": ">=0.74.0",
|
|
54
|
-
"react-native-safe-area-context": "~5.6.0",
|
|
55
|
-
"react-native-svg": "^15.0.0",
|
|
56
|
-
"zustand": "^5.0.2"
|
|
32
|
+
"@umituz/react-native-about": "latest",
|
|
33
|
+
"@umituz/react-native-appearance": "latest",
|
|
34
|
+
"@umituz/react-native-avatar": "latest",
|
|
35
|
+
"@umituz/react-native-faqs": "latest",
|
|
36
|
+
"@umituz/react-native-feedback": "latest",
|
|
37
|
+
"@umituz/react-native-legal": "latest",
|
|
38
|
+
"@umituz/react-native-localization": "latest",
|
|
39
|
+
"@umituz/react-native-notifications": "latest",
|
|
40
|
+
"@umituz/react-native-onboarding": "latest",
|
|
41
|
+
"@umituz/react-native-rating": "latest",
|
|
42
|
+
"@umituz/react-native-storage": "latest",
|
|
43
|
+
"react": ">=19.0.0",
|
|
44
|
+
"react-native": ">=0.81.0",
|
|
45
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
46
|
+
"zustand": ">=5.0.0"
|
|
57
47
|
},
|
|
58
48
|
"devDependencies": {
|
|
59
49
|
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
60
|
-
"@expo/vector-icons": "^
|
|
61
|
-
"@react-native/babel-preset": "^0.83.0",
|
|
62
|
-
"@react-navigation/native": "^6.1.17",
|
|
63
|
-
"@react-navigation/stack": "^7.6.12",
|
|
64
|
-
"@testing-library/jest-native": "^5.4.3",
|
|
65
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
66
|
-
"@testing-library/react-native": "^12.9.0",
|
|
50
|
+
"@expo/vector-icons": "^15.0.0",
|
|
67
51
|
"@types/jest": "^29.5.14",
|
|
68
|
-
"@types/react": "
|
|
69
|
-
"@
|
|
70
|
-
"@umituz/react-native-
|
|
71
|
-
"@umituz/react-native-alert": "latest",
|
|
72
|
-
"@umituz/react-native-appearance": "^2.0.2",
|
|
52
|
+
"@types/react": "~19.1.10",
|
|
53
|
+
"@umituz/react-native-about": "latest",
|
|
54
|
+
"@umituz/react-native-appearance": "latest",
|
|
73
55
|
"@umituz/react-native-avatar": "latest",
|
|
74
|
-
"@umituz/react-native-design-system": "latest",
|
|
75
|
-
"@umituz/react-native-design-system-atoms": "latest",
|
|
76
|
-
"@umituz/react-native-design-system-molecules": "latest",
|
|
77
|
-
"@umituz/react-native-design-system-organisms": "latest",
|
|
78
|
-
"@umituz/react-native-design-system-responsive": "latest",
|
|
79
|
-
"@umituz/react-native-design-system-theme": "latest",
|
|
80
|
-
"@umituz/react-native-design-system-typography": "latest",
|
|
81
56
|
"@umituz/react-native-faqs": "latest",
|
|
82
|
-
"@umituz/react-native-feedback": "
|
|
83
|
-
"@umituz/react-native-legal": "
|
|
57
|
+
"@umituz/react-native-feedback": "latest",
|
|
58
|
+
"@umituz/react-native-legal": "latest",
|
|
84
59
|
"@umituz/react-native-localization": "latest",
|
|
85
60
|
"@umituz/react-native-notifications": "latest",
|
|
86
|
-
"@umituz/react-native-onboarding": "
|
|
87
|
-
"@umituz/react-native-rating": "
|
|
61
|
+
"@umituz/react-native-onboarding": "latest",
|
|
62
|
+
"@umituz/react-native-rating": "latest",
|
|
88
63
|
"@umituz/react-native-storage": "latest",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"metro-react-native-babel-preset": "^0.77.0",
|
|
93
|
-
"react": "^18.2.0",
|
|
94
|
-
"react-native": "^0.74.0",
|
|
95
|
-
"react-native-svg": "^15.15.1",
|
|
96
|
-
"react-test-renderer": "^18.3.1",
|
|
97
|
-
"typescript": "^5.3.3"
|
|
64
|
+
"react": "19.1.0",
|
|
65
|
+
"react-native": "0.81.5",
|
|
66
|
+
"typescript": "^5.3.0"
|
|
98
67
|
},
|
|
99
68
|
"publishConfig": {
|
|
100
69
|
"access": "public"
|
|
@@ -10,7 +10,7 @@ import { SettingsScreen } from '../../screens/SettingsScreen';
|
|
|
10
10
|
import { useSettings } from '../../../infrastructure/storage/SettingsStore';
|
|
11
11
|
|
|
12
12
|
// Mock all dependencies
|
|
13
|
-
jest.mock('@umituz/react-native-design-system
|
|
13
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
14
14
|
useDesignSystemTheme: () => ({
|
|
15
15
|
themeMode: 'light',
|
|
16
16
|
}),
|
|
@@ -11,7 +11,7 @@ import { DisclaimerSetting } from '../../components/DisclaimerSetting';
|
|
|
11
11
|
import { SettingItem } from '../../components/SettingItem';
|
|
12
12
|
|
|
13
13
|
// Mock dependencies
|
|
14
|
-
jest.mock('@umituz/react-native-design-system
|
|
14
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
15
15
|
useDesignSystemTheme: () => ({
|
|
16
16
|
themeMode: 'light',
|
|
17
17
|
}),
|
package/src/__tests__/setup.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
8
8
|
|
|
9
9
|
// Mock design system packages
|
|
10
|
-
jest.mock('@umituz/react-native-design-system
|
|
10
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
11
11
|
useDesignSystemTheme: () => ({
|
|
12
12
|
themeMode: 'light',
|
|
13
13
|
}),
|
|
@@ -34,7 +34,7 @@ jest.mock('@umituz/react-native-design-system-theme', () => ({
|
|
|
34
34
|
withAlpha: jest.fn((color: string, alpha: number) => `${color}${alpha}`),
|
|
35
35
|
}));
|
|
36
36
|
|
|
37
|
-
jest.mock('@umituz/react-native-design-system
|
|
37
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
38
38
|
AtomicText: ({ children, type, color, style, testID }: any) => {
|
|
39
39
|
const React = require('react');
|
|
40
40
|
const { Text } = require('react-native');
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import React from "react";
|
|
11
11
|
import { Alert } from "react-native";
|
|
12
12
|
import { Feather } from "@expo/vector-icons";
|
|
13
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
13
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
14
14
|
import { storageRepository } from "@umituz/react-native-storage";
|
|
15
15
|
import { SettingsSection } from "./SettingsSection";
|
|
16
16
|
import { SettingItem } from "./SettingItem";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, Pressable, StyleSheet, Switch } from "react-native";
|
|
9
9
|
import { Feather } from "@expo/vector-icons";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
11
|
|
|
12
12
|
export interface SettingItemProps {
|
|
13
13
|
/** Icon component from @expo/vector-icons */
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import React, { Component, ReactNode } from 'react';
|
|
7
7
|
import { View, StyleSheet } from 'react-native';
|
|
8
|
-
import { useAppDesignTokens } from '@umituz/react-native-design-system
|
|
9
|
-
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system
|
|
8
|
+
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
9
|
+
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
children: ReactNode;
|
|
@@ -5,28 +5,29 @@
|
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, Text, StyleSheet } from "react-native";
|
|
8
|
-
import {
|
|
9
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
8
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
10
9
|
|
|
11
10
|
export interface SettingsFooterProps {
|
|
12
11
|
/** Custom version text (optional) - should include version number from app config */
|
|
13
12
|
versionText?: string;
|
|
14
13
|
/** App version number from app config (e.g., "1.0.0") */
|
|
15
14
|
appVersion?: string;
|
|
15
|
+
/** Label for version (e.g., "Version") */
|
|
16
|
+
versionLabel?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const SettingsFooter: React.FC<SettingsFooterProps> = ({
|
|
19
20
|
versionText,
|
|
20
21
|
appVersion,
|
|
22
|
+
versionLabel = "Version",
|
|
21
23
|
}) => {
|
|
22
|
-
const { t } = useLocalization();
|
|
23
24
|
const tokens = useAppDesignTokens();
|
|
24
25
|
const colors = tokens.colors;
|
|
25
26
|
|
|
26
27
|
// If versionText is provided, use it directly
|
|
27
|
-
// Otherwise build from
|
|
28
|
+
// Otherwise build from label + appVersion
|
|
28
29
|
const displayText = versionText || (appVersion
|
|
29
|
-
? `${
|
|
30
|
+
? `${versionLabel} ${appVersion}`
|
|
30
31
|
: undefined);
|
|
31
32
|
|
|
32
33
|
// Don't render if no version info available
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, Text, StyleSheet } from "react-native";
|
|
8
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
8
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
9
|
|
|
10
10
|
export interface SettingsSectionProps {
|
|
11
11
|
/** Section title */
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import React, { useCallback } from "react";
|
|
8
8
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
9
9
|
import { Feather } from "@expo/vector-icons";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
11
|
-
import { AtomicText } from "@umituz/react-native-design-system
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
|
+
import { AtomicText } from "@umituz/react-native-design-system";
|
|
12
12
|
import { useNavigation } from "@react-navigation/native";
|
|
13
13
|
import { Avatar } from "@umituz/react-native-avatar";
|
|
14
14
|
|
|
@@ -14,7 +14,7 @@ jest.mock('lucide-react-native', () => ({
|
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
16
|
// Mock dependencies
|
|
17
|
-
jest.mock('@umituz/react-native-design-system
|
|
17
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
18
18
|
useAppDesignTokens: () => ({
|
|
19
19
|
colors: {
|
|
20
20
|
backgroundPrimary: '#ffffff',
|
|
@@ -7,7 +7,7 @@ import { render, Text } from '@testing-library/react-native';
|
|
|
7
7
|
import { SettingsErrorBoundary } from '../SettingsErrorBoundary';
|
|
8
8
|
|
|
9
9
|
// Mock dependencies
|
|
10
|
-
jest.mock('@umituz/react-native-design-system
|
|
10
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
11
11
|
useAppDesignTokens: () => ({
|
|
12
12
|
colors: {
|
|
13
13
|
backgroundPrimary: '#ffffff',
|
|
@@ -16,7 +16,7 @@ jest.mock('@umituz/react-native-design-system-theme', () => ({
|
|
|
16
16
|
}),
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
|
-
jest.mock('@umituz/react-native-design-system
|
|
19
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
20
20
|
AtomicText: ({ children, type, color, style }: any) => (
|
|
21
21
|
<Text style={style} testID={`atomic-text-${type}-${color}`}>
|
|
22
22
|
{children}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { createStackNavigator } from "@react-navigation/stack";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
11
|
import { SettingsScreen } from "../screens/SettingsScreen";
|
|
12
12
|
import { AppearanceScreen } from "../screens/AppearanceScreen";
|
|
13
13
|
import type { SettingsConfig } from "../screens/types";
|
|
@@ -9,7 +9,7 @@ import { useNavigation } from "@react-navigation/native";
|
|
|
9
9
|
import {
|
|
10
10
|
useDesignSystemTheme,
|
|
11
11
|
useAppDesignTokens,
|
|
12
|
-
} from "@umituz/react-native-design-system
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
13
13
|
import { SettingsHeader } from "./components/SettingsHeader";
|
|
14
14
|
import { SettingsContent } from "./components/SettingsContent";
|
|
15
15
|
import { SettingsErrorBoundary } from "../components/SettingsErrorBoundary";
|
|
@@ -8,7 +8,7 @@ import { SettingsScreen } from '../SettingsScreen';
|
|
|
8
8
|
import { NavigationContainer } from '@react-navigation/native';
|
|
9
9
|
|
|
10
10
|
// Mock dependencies
|
|
11
|
-
jest.mock('@umituz/react-native-design-system
|
|
11
|
+
jest.mock('@umituz/react-native-design-system', () => ({
|
|
12
12
|
useDesignSystemTheme: () => ({
|
|
13
13
|
themeMode: 'light',
|
|
14
14
|
}),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React, { useMemo } from "react";
|
|
7
7
|
import { View, ScrollView, StyleSheet } from "react-native";
|
|
8
8
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
10
10
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
11
11
|
import { SettingsFooter } from "../../components/SettingsFooter";
|
|
12
12
|
import { UserProfileHeader } from "../../components/UserProfileHeader";
|
|
@@ -144,6 +144,8 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
144
144
|
onPress={userProfile?.onPress}
|
|
145
145
|
anonymousDisplayName={userProfile?.anonymousDisplayName}
|
|
146
146
|
avatarServiceUrl={userProfile?.avatarServiceUrl}
|
|
147
|
+
defaultUserDisplayName={t("settings.profile.defaultUserName")}
|
|
148
|
+
defaultAnonymousDisplayName={t("settings.profile.anonymousName")}
|
|
147
149
|
/>
|
|
148
150
|
</View>
|
|
149
151
|
)}
|
|
@@ -167,6 +169,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
167
169
|
normalizedConfig.appearance.config?.description ||
|
|
168
170
|
t("settings.appearance.description"),
|
|
169
171
|
}}
|
|
172
|
+
sectionTitle={t("settings.appearance.title")}
|
|
170
173
|
/>
|
|
171
174
|
)}
|
|
172
175
|
|
|
@@ -179,6 +182,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
179
182
|
normalizedConfig.language.config?.description ||
|
|
180
183
|
t("settings.languageSelection.description"),
|
|
181
184
|
}}
|
|
185
|
+
sectionTitle={t("settings.languageSelection.title")}
|
|
182
186
|
/>
|
|
183
187
|
)}
|
|
184
188
|
|
|
@@ -207,6 +211,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
207
211
|
normalizedConfig.about.config?.description ||
|
|
208
212
|
t("settings.about.description"),
|
|
209
213
|
}}
|
|
214
|
+
sectionTitle={t("settings.about.title")}
|
|
210
215
|
/>
|
|
211
216
|
)}
|
|
212
217
|
|
|
@@ -221,6 +226,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
221
226
|
normalizedConfig.legal.config?.description ||
|
|
222
227
|
t("settings.legal.description"),
|
|
223
228
|
}}
|
|
229
|
+
sectionTitle={t("settings.legal.title")}
|
|
224
230
|
/>
|
|
225
231
|
)}
|
|
226
232
|
|
|
@@ -295,7 +301,13 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
295
301
|
/>
|
|
296
302
|
)}
|
|
297
303
|
|
|
298
|
-
{showFooter &&
|
|
304
|
+
{showFooter && (
|
|
305
|
+
<SettingsFooter
|
|
306
|
+
versionText={footerText}
|
|
307
|
+
appVersion={appVersion}
|
|
308
|
+
versionLabel={t("settings.footer.version")}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
299
311
|
</ScrollView>
|
|
300
312
|
);
|
|
301
313
|
};
|
|
@@ -7,8 +7,8 @@ import React from "react";
|
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
8
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
9
|
import { useNavigation } from "@react-navigation/native";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system
|
|
11
|
-
import { AtomicIcon } from "@umituz/react-native-design-system
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
|
+
import { AtomicIcon } from "@umituz/react-native-design-system";
|
|
12
12
|
|
|
13
13
|
interface SettingsHeaderProps {
|
|
14
14
|
showCloseButton?: boolean;
|