@umituz/react-native-settings 1.3.2 → 1.3.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/package.json
CHANGED
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
import React, { useMemo } from 'react';
|
|
15
15
|
import { List, Divider } from 'react-native-paper';
|
|
16
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
17
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
16
18
|
|
|
17
19
|
import { useNavigation } from '@react-navigation/native';
|
|
18
|
-
import { useTheme } from '@umituz/react-native-design-system-theme';
|
|
19
|
-
import { ScreenLayout } from '@umituz/react-native-design-system';
|
|
20
|
+
import { useTheme, useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
21
|
+
import { ScreenLayout, AtomicIcon, AtomicText } from '@umituz/react-native-design-system';
|
|
20
22
|
import { SettingItem } from '../components/SettingItem';
|
|
21
23
|
import { getLanguageByCode, useLocalization } from '@umituz/react-native-localization';
|
|
22
24
|
import { SettingsConfig } from './types';
|
|
@@ -76,6 +78,8 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
76
78
|
}) => {
|
|
77
79
|
const navigation = useNavigation();
|
|
78
80
|
const { theme, themeMode } = useTheme();
|
|
81
|
+
const tokens = useAppDesignTokens();
|
|
82
|
+
const insets = useSafeAreaInsets();
|
|
79
83
|
const { currentLanguage, t } = useLocalization();
|
|
80
84
|
|
|
81
85
|
const currentLang = getLanguageByCode(currentLanguage);
|
|
@@ -125,6 +129,12 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
125
129
|
navigation.navigate('Notifications' as never);
|
|
126
130
|
};
|
|
127
131
|
|
|
132
|
+
const handleClose = () => {
|
|
133
|
+
if (navigation.canGoBack()) {
|
|
134
|
+
navigation.goBack();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
128
138
|
// Debug: Log features to help diagnose empty screen issues
|
|
129
139
|
/* eslint-disable-next-line no-console */
|
|
130
140
|
if (__DEV__) {
|
|
@@ -138,6 +148,28 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
138
148
|
|
|
139
149
|
return (
|
|
140
150
|
<ScreenLayout testID="settings-screen" hideScrollIndicator>
|
|
151
|
+
{/* Header with Close Button */}
|
|
152
|
+
<View style={[
|
|
153
|
+
styles.header,
|
|
154
|
+
{
|
|
155
|
+
borderBottomColor: theme.colors.borderLight,
|
|
156
|
+
backgroundColor: theme.colors.surface,
|
|
157
|
+
paddingTop: insets.top,
|
|
158
|
+
}
|
|
159
|
+
]}>
|
|
160
|
+
<AtomicText type="headlineLarge" style={{ color: theme.colors.textPrimary, flex: 1 }}>
|
|
161
|
+
{t('navigation.settings') || 'Settings'}
|
|
162
|
+
</AtomicText>
|
|
163
|
+
<TouchableOpacity
|
|
164
|
+
onPress={handleClose}
|
|
165
|
+
style={styles.closeButton}
|
|
166
|
+
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
|
|
167
|
+
testID="close-settings-button"
|
|
168
|
+
>
|
|
169
|
+
<AtomicIcon name="X" size="lg" color="textPrimary" />
|
|
170
|
+
</TouchableOpacity>
|
|
171
|
+
</View>
|
|
172
|
+
|
|
141
173
|
{/* Appearance Section */}
|
|
142
174
|
{features.appearance && (
|
|
143
175
|
<List.Section style={{ marginBottom: 8 }}>
|
|
@@ -208,3 +240,20 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
208
240
|
);
|
|
209
241
|
};
|
|
210
242
|
|
|
243
|
+
const styles = StyleSheet.create({
|
|
244
|
+
header: {
|
|
245
|
+
flexDirection: 'row',
|
|
246
|
+
alignItems: 'center',
|
|
247
|
+
justifyContent: 'space-between',
|
|
248
|
+
paddingHorizontal: 16,
|
|
249
|
+
paddingBottom: 12,
|
|
250
|
+
paddingTop: 12,
|
|
251
|
+
borderBottomWidth: 1,
|
|
252
|
+
zIndex: 1000,
|
|
253
|
+
},
|
|
254
|
+
closeButton: {
|
|
255
|
+
padding: 8,
|
|
256
|
+
marginLeft: 8,
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
|