@umituz/react-native-settings 4.20.19 → 4.20.20
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.20",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, and rating",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -58,7 +58,7 @@ export const SettingsItemCard: React.FC<SettingsItemCardProps> = ({
|
|
|
58
58
|
|
|
59
59
|
const renderContent = () => (
|
|
60
60
|
<View style={styles.content}>
|
|
61
|
-
<View style={[styles.iconContainer, { backgroundColor: defaultIconBg }]}>
|
|
61
|
+
<View style={[styles.iconContainer, { backgroundColor: defaultIconBg, borderRadius: tokens.borderRadius.md }]}>
|
|
62
62
|
<AtomicIcon name={icon} size="lg" customColor={defaultIconColor} />
|
|
63
63
|
</View>
|
|
64
64
|
<View style={styles.textContainer}>
|
|
@@ -66,7 +66,7 @@ export const SettingsItemCard: React.FC<SettingsItemCardProps> = ({
|
|
|
66
66
|
type="bodyLarge"
|
|
67
67
|
color="onSurface"
|
|
68
68
|
numberOfLines={1}
|
|
69
|
-
style={{ marginBottom:
|
|
69
|
+
style={{ marginBottom: tokens.spacing.xs }}
|
|
70
70
|
>
|
|
71
71
|
{title}
|
|
72
72
|
</AtomicText>
|
|
@@ -86,13 +86,16 @@ export const SettingsItemCard: React.FC<SettingsItemCardProps> = ({
|
|
|
86
86
|
<View
|
|
87
87
|
style={[
|
|
88
88
|
styles.sectionContainer,
|
|
89
|
-
{
|
|
89
|
+
{
|
|
90
|
+
backgroundColor: colors.surface,
|
|
91
|
+
borderRadius: tokens.borderRadius.lg,
|
|
92
|
+
},
|
|
90
93
|
containerStyle,
|
|
91
94
|
]}
|
|
92
95
|
>
|
|
93
96
|
{!!sectionTitle && (
|
|
94
97
|
<View style={styles.headerContainer}>
|
|
95
|
-
<AtomicText type="
|
|
98
|
+
<AtomicText type="labelMedium" color="textSecondary" style={{ textTransform: 'uppercase' }}>
|
|
96
99
|
{sectionTitle}
|
|
97
100
|
</AtomicText>
|
|
98
101
|
</View>
|
|
@@ -121,7 +124,6 @@ export const SettingsItemCard: React.FC<SettingsItemCardProps> = ({
|
|
|
121
124
|
const styles = StyleSheet.create({
|
|
122
125
|
sectionContainer: {
|
|
123
126
|
marginBottom: 16,
|
|
124
|
-
borderRadius: 12,
|
|
125
127
|
overflow: "hidden",
|
|
126
128
|
},
|
|
127
129
|
headerContainer: {
|
|
@@ -144,7 +146,6 @@ const styles = StyleSheet.create({
|
|
|
144
146
|
iconContainer: {
|
|
145
147
|
width: 48,
|
|
146
148
|
height: 48,
|
|
147
|
-
borderRadius: 12,
|
|
148
149
|
justifyContent: "center",
|
|
149
150
|
alignItems: "center",
|
|
150
151
|
marginRight: 16,
|
|
@@ -7,8 +7,8 @@ import React from "react";
|
|
|
7
7
|
import { View, StatusBar, StyleSheet } from "react-native";
|
|
8
8
|
import { useNavigation } from "@react-navigation/native";
|
|
9
9
|
import {
|
|
10
|
-
useDesignSystemTheme,
|
|
11
10
|
useAppDesignTokens,
|
|
11
|
+
ScreenLayout,
|
|
12
12
|
} from "@umituz/react-native-design-system";
|
|
13
13
|
import { SettingsHeader } from "./components/SettingsHeader";
|
|
14
14
|
import { SettingsContent } from "./components/SettingsContent";
|
|
@@ -67,12 +67,8 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
67
67
|
devSettings,
|
|
68
68
|
}) => {
|
|
69
69
|
const navigation = useNavigation();
|
|
70
|
-
const { themeMode } = useDesignSystemTheme();
|
|
71
70
|
const tokens = useAppDesignTokens();
|
|
72
71
|
|
|
73
|
-
const isDark = themeMode === "dark";
|
|
74
|
-
const colors = tokens.colors;
|
|
75
|
-
|
|
76
72
|
const normalizedConfig = normalizeSettingsConfig(config);
|
|
77
73
|
const features = useFeatureDetection(normalizedConfig, navigation, featureOptions);
|
|
78
74
|
|
|
@@ -80,11 +76,9 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
80
76
|
const shouldShowUserProfile = showUserProfile ?? features.userProfile;
|
|
81
77
|
|
|
82
78
|
return (
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
<SettingsHeader showCloseButton={showCloseButton} onClose={onClose} />
|
|
87
|
-
|
|
79
|
+
<ScreenLayout
|
|
80
|
+
header={<SettingsHeader showCloseButton={showCloseButton} onClose={onClose} />}
|
|
81
|
+
>
|
|
88
82
|
<SettingsErrorBoundary>
|
|
89
83
|
<SettingsContent
|
|
90
84
|
normalizedConfig={normalizedConfig}
|
|
@@ -99,7 +93,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
99
93
|
devSettings={devSettings}
|
|
100
94
|
/>
|
|
101
95
|
</SettingsErrorBoundary>
|
|
102
|
-
</
|
|
96
|
+
</ScreenLayout>
|
|
103
97
|
);
|
|
104
98
|
};
|
|
105
99
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
-
import { View,
|
|
3
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
4
3
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
5
4
|
import { useLocalization } from "@umituz/react-native-localization";
|
|
6
5
|
import { SettingsFooter } from "../../components/SettingsFooter";
|
|
@@ -56,7 +55,6 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
56
55
|
devSettings,
|
|
57
56
|
}) => {
|
|
58
57
|
const tokens = useAppDesignTokens();
|
|
59
|
-
const insets = useSafeAreaInsets();
|
|
60
58
|
const { t } = useLocalization();
|
|
61
59
|
|
|
62
60
|
const hasAnyFeatures = useMemo(() =>
|
|
@@ -75,18 +73,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
75
73
|
);
|
|
76
74
|
|
|
77
75
|
return (
|
|
78
|
-
<
|
|
79
|
-
style={styles.scrollView}
|
|
80
|
-
contentContainerStyle={[
|
|
81
|
-
styles.scrollContent,
|
|
82
|
-
{
|
|
83
|
-
paddingTop: showCloseButton ? tokens.spacing.md : insets.top + tokens.spacing.md,
|
|
84
|
-
paddingBottom: tokens.spacing.xxxl + tokens.spacing.xl,
|
|
85
|
-
paddingHorizontal: tokens.spacing.md,
|
|
86
|
-
},
|
|
87
|
-
]}
|
|
88
|
-
showsVerticalScrollIndicator={false}
|
|
89
|
-
>
|
|
76
|
+
<View style={styles.container}>
|
|
90
77
|
{showUserProfile && <ProfileSectionLoader userProfile={userProfile} />}
|
|
91
78
|
|
|
92
79
|
<CustomSettingsList customSections={customSections} />
|
|
@@ -120,12 +107,14 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
|
|
|
120
107
|
versionLabel={t("settings.footer.version")}
|
|
121
108
|
/>
|
|
122
109
|
)}
|
|
123
|
-
</
|
|
110
|
+
</View>
|
|
124
111
|
);
|
|
125
112
|
};
|
|
126
113
|
|
|
127
114
|
const styles = StyleSheet.create({
|
|
128
|
-
|
|
129
|
-
|
|
115
|
+
container: {
|
|
116
|
+
flex: 1,
|
|
117
|
+
paddingVertical: 16,
|
|
118
|
+
},
|
|
130
119
|
emptyContainer: { paddingVertical: 24 },
|
|
131
120
|
});
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { View,
|
|
8
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
|
+
import { View, Pressable, StyleSheet } from "react-native";
|
|
9
8
|
import { useNavigation } from "@react-navigation/native";
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
|
-
import {
|
|
9
|
+
import { useAppDesignTokens, AtomicIcon, AtomicText } from "@umituz/react-native-design-system";
|
|
10
|
+
import { useLocalization } from "@umituz/react-native-localization";
|
|
12
11
|
|
|
13
12
|
interface SettingsHeaderProps {
|
|
14
13
|
showCloseButton?: boolean;
|
|
@@ -21,7 +20,7 @@ export const SettingsHeader: React.FC<SettingsHeaderProps> = ({
|
|
|
21
20
|
}) => {
|
|
22
21
|
const navigation = useNavigation();
|
|
23
22
|
const tokens = useAppDesignTokens();
|
|
24
|
-
const
|
|
23
|
+
const { t } = useLocalization();
|
|
25
24
|
|
|
26
25
|
const handleClose = () => {
|
|
27
26
|
if (onClose) {
|
|
@@ -31,48 +30,40 @@ export const SettingsHeader: React.FC<SettingsHeaderProps> = ({
|
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
if (!showCloseButton) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
33
|
return (
|
|
39
|
-
<View
|
|
40
|
-
style={
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</TouchableOpacity>
|
|
34
|
+
<View style={[styles.container, { padding: tokens.spacing.lg }]}>
|
|
35
|
+
<AtomicText style={tokens.typography.headingLarge}>
|
|
36
|
+
{t('settings.title')}
|
|
37
|
+
</AtomicText>
|
|
38
|
+
|
|
39
|
+
{showCloseButton && (
|
|
40
|
+
<Pressable
|
|
41
|
+
onPress={handleClose}
|
|
42
|
+
style={({ pressed }) => [
|
|
43
|
+
styles.closeButton,
|
|
44
|
+
{
|
|
45
|
+
backgroundColor: pressed ? tokens.colors.surfaceVariant : tokens.colors.surface,
|
|
46
|
+
borderRadius: tokens.borderRadius.full,
|
|
47
|
+
},
|
|
48
|
+
]}
|
|
49
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
50
|
+
>
|
|
51
|
+
<AtomicIcon name="close-outline" size="lg" color="textPrimary" />
|
|
52
|
+
</Pressable>
|
|
53
|
+
)}
|
|
60
54
|
</View>
|
|
61
55
|
);
|
|
62
56
|
};
|
|
63
57
|
|
|
64
58
|
const styles = StyleSheet.create({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
zIndex: 10,
|
|
70
|
-
alignItems: "flex-end",
|
|
59
|
+
container: {
|
|
60
|
+
flexDirection: 'row',
|
|
61
|
+
justifyContent: 'space-between',
|
|
62
|
+
alignItems: 'center',
|
|
71
63
|
},
|
|
72
64
|
closeButton: {
|
|
73
65
|
width: 44,
|
|
74
66
|
height: 44,
|
|
75
|
-
borderRadius: 22,
|
|
76
67
|
justifyContent: "center",
|
|
77
68
|
alignItems: "center",
|
|
78
69
|
},
|