@umituz/react-native-settings 1.3.1 → 1.3.3
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,11 @@
|
|
|
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';
|
|
16
17
|
|
|
17
18
|
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';
|
|
19
|
+
import { useTheme, useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
20
|
+
import { ScreenLayout, AtomicIcon, AtomicText } from '@umituz/react-native-design-system';
|
|
20
21
|
import { SettingItem } from '../components/SettingItem';
|
|
21
22
|
import { getLanguageByCode, useLocalization } from '@umituz/react-native-localization';
|
|
22
23
|
import { SettingsConfig } from './types';
|
|
@@ -76,6 +77,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
76
77
|
}) => {
|
|
77
78
|
const navigation = useNavigation();
|
|
78
79
|
const { theme, themeMode } = useTheme();
|
|
80
|
+
const tokens = useAppDesignTokens();
|
|
79
81
|
const { currentLanguage, t } = useLocalization();
|
|
80
82
|
|
|
81
83
|
const currentLang = getLanguageByCode(currentLanguage);
|
|
@@ -125,6 +127,12 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
125
127
|
navigation.navigate('Notifications' as never);
|
|
126
128
|
};
|
|
127
129
|
|
|
130
|
+
const handleClose = () => {
|
|
131
|
+
if (navigation.canGoBack()) {
|
|
132
|
+
navigation.goBack();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
128
136
|
// Debug: Log features to help diagnose empty screen issues
|
|
129
137
|
/* eslint-disable-next-line no-console */
|
|
130
138
|
if (__DEV__) {
|
|
@@ -138,6 +146,21 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
138
146
|
|
|
139
147
|
return (
|
|
140
148
|
<ScreenLayout testID="settings-screen" hideScrollIndicator>
|
|
149
|
+
{/* Header with Close Button */}
|
|
150
|
+
<View style={[styles.header, { borderBottomColor: theme.colors.borderLight }]}>
|
|
151
|
+
<AtomicText type="headlineLarge" style={{ color: theme.colors.textPrimary, flex: 1 }}>
|
|
152
|
+
{t('navigation.settings') || 'Settings'}
|
|
153
|
+
</AtomicText>
|
|
154
|
+
<TouchableOpacity
|
|
155
|
+
onPress={handleClose}
|
|
156
|
+
style={styles.closeButton}
|
|
157
|
+
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
|
|
158
|
+
testID="close-settings-button"
|
|
159
|
+
>
|
|
160
|
+
<AtomicIcon name="X" size="lg" color="textPrimary" />
|
|
161
|
+
</TouchableOpacity>
|
|
162
|
+
</View>
|
|
163
|
+
|
|
141
164
|
{/* Appearance Section */}
|
|
142
165
|
{features.appearance && (
|
|
143
166
|
<List.Section style={{ marginBottom: 8 }}>
|
|
@@ -208,3 +231,17 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
|
|
|
208
231
|
);
|
|
209
232
|
};
|
|
210
233
|
|
|
234
|
+
const styles = StyleSheet.create({
|
|
235
|
+
header: {
|
|
236
|
+
flexDirection: 'row',
|
|
237
|
+
alignItems: 'center',
|
|
238
|
+
justifyContent: 'space-between',
|
|
239
|
+
paddingHorizontal: 16,
|
|
240
|
+
paddingVertical: 12,
|
|
241
|
+
borderBottomWidth: 1,
|
|
242
|
+
},
|
|
243
|
+
closeButton: {
|
|
244
|
+
padding: 4,
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
|