@umituz/react-native-settings 4.23.50 → 4.23.52
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 +2 -2
- package/src/domains/appearance/presentation/components/CustomColorsSection.tsx +4 -10
- package/src/presentation/navigation/SettingsStackNavigator.tsx +6 -0
- package/src/presentation/navigation/components/wrappers/SettingsScreenWrapper.tsx +6 -0
- package/src/presentation/navigation/types.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.52",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
78
78
|
"@typescript-eslint/parser": "^7.18.0",
|
|
79
79
|
"@umituz/react-native-auth": "^3.6.49",
|
|
80
|
-
"@umituz/react-native-design-system": "^4.23.
|
|
80
|
+
"@umituz/react-native-design-system": "^4.23.50",
|
|
81
81
|
"@umituz/react-native-firebase": "^1.13.102",
|
|
82
82
|
"@umituz/react-native-sentry": "*",
|
|
83
83
|
"eslint": "^8.57.0",
|
|
@@ -81,12 +81,6 @@ export const CustomColorsSection: React.FC<CustomColorsSectionProps> = ({
|
|
|
81
81
|
// Memoize styles to prevent unnecessary re-creation
|
|
82
82
|
const styles = useMemo(() => getStyles(tokens), [tokens]);
|
|
83
83
|
|
|
84
|
-
// Memoize hasCustomColors check to prevent unnecessary re-renders
|
|
85
|
-
const hasCustomColors = useMemo(() =>
|
|
86
|
-
Object.keys(localCustomColors).length > 0,
|
|
87
|
-
[localCustomColors]
|
|
88
|
-
);
|
|
89
|
-
|
|
90
84
|
// Memoize color fields to prevent unnecessary re-renders
|
|
91
85
|
const colorFieldsMemo = useMemo(() => colorFields, [colorFields]);
|
|
92
86
|
|
|
@@ -123,14 +117,14 @@ export const CustomColorsSection: React.FC<CustomColorsSectionProps> = ({
|
|
|
123
117
|
|
|
124
118
|
// Memoize reset button to prevent unnecessary re-renders
|
|
125
119
|
const resetButton = useMemo(() => {
|
|
126
|
-
if (!showResetButton
|
|
127
|
-
|
|
120
|
+
if (!showResetButton) return null;
|
|
121
|
+
|
|
128
122
|
return (
|
|
129
123
|
<AtomicButton variant="outline" size="sm" onPress={handleResetColors}>
|
|
130
|
-
{resetButtonText}
|
|
124
|
+
{resetButtonText || "Reset"}
|
|
131
125
|
</AtomicButton>
|
|
132
126
|
);
|
|
133
|
-
}, [showResetButton,
|
|
127
|
+
}, [showResetButton, resetButtonText, handleResetColors]);
|
|
134
128
|
|
|
135
129
|
return (
|
|
136
130
|
<View style={styles.section}>
|
|
@@ -38,6 +38,8 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
|
|
|
38
38
|
devSettings,
|
|
39
39
|
customSections = [],
|
|
40
40
|
showHeader = true,
|
|
41
|
+
showCloseButton = false,
|
|
42
|
+
onClose,
|
|
41
43
|
gamificationConfig,
|
|
42
44
|
}) => {
|
|
43
45
|
const tokens = useAppDesignTokens();
|
|
@@ -85,6 +87,8 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
|
|
|
85
87
|
devSettings={devSettings}
|
|
86
88
|
customSections={customSections}
|
|
87
89
|
showHeader={showHeader}
|
|
90
|
+
showCloseButton={showCloseButton}
|
|
91
|
+
onClose={onClose}
|
|
88
92
|
/>
|
|
89
93
|
),
|
|
90
94
|
},
|
|
@@ -172,6 +176,8 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
|
|
|
172
176
|
}, [
|
|
173
177
|
t,
|
|
174
178
|
showHeader,
|
|
179
|
+
showCloseButton,
|
|
180
|
+
onClose,
|
|
175
181
|
config,
|
|
176
182
|
appInfo.version,
|
|
177
183
|
showUserProfile,
|
|
@@ -12,6 +12,8 @@ export interface SettingsScreenWrapperProps {
|
|
|
12
12
|
devSettings: any;
|
|
13
13
|
customSections: any[];
|
|
14
14
|
showHeader?: boolean;
|
|
15
|
+
showCloseButton?: boolean;
|
|
16
|
+
onClose?: () => void;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const SettingsScreenWrapper: React.FC<SettingsScreenWrapperProps> = ({
|
|
@@ -22,6 +24,8 @@ export const SettingsScreenWrapper: React.FC<SettingsScreenWrapperProps> = ({
|
|
|
22
24
|
devSettings,
|
|
23
25
|
customSections,
|
|
24
26
|
showHeader,
|
|
27
|
+
showCloseButton,
|
|
28
|
+
onClose,
|
|
25
29
|
}) => (
|
|
26
30
|
<SettingsScreen
|
|
27
31
|
config={config}
|
|
@@ -31,5 +35,7 @@ export const SettingsScreenWrapper: React.FC<SettingsScreenWrapperProps> = ({
|
|
|
31
35
|
devSettings={devSettings}
|
|
32
36
|
customSections={customSections}
|
|
33
37
|
showHeader={showHeader}
|
|
38
|
+
showCloseButton={showCloseButton}
|
|
39
|
+
onClose={onClose}
|
|
34
40
|
/>
|
|
35
41
|
);
|
|
@@ -99,5 +99,9 @@ export interface SettingsStackNavigatorProps {
|
|
|
99
99
|
devSettings?: DevSettingsProps;
|
|
100
100
|
customSections?: CustomSettingsSection[];
|
|
101
101
|
showHeader?: boolean;
|
|
102
|
+
/** Show close button in header (useful for modal presentation) */
|
|
103
|
+
showCloseButton?: boolean;
|
|
104
|
+
/** Custom close handler */
|
|
105
|
+
onClose?: () => void;
|
|
102
106
|
gamificationConfig?: import("../../domains/gamification").GamificationSettingsConfig;
|
|
103
107
|
}
|