@umituz/react-native-settings 1.4.0 → 1.4.1

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": "1.4.0",
3
+ "version": "1.4.1",
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",
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import { View, StyleSheet } from 'react-native';
14
14
 
15
15
  import { useNavigation } from '@react-navigation/native';
16
- import { useTheme, useAppDesignTokens, type DesignTokens } from '@umituz/react-native-design-system-theme';
16
+ import { useDesignSystemTheme, useAppDesignTokens, type DesignTokens } from '@umituz/react-native-design-system-theme';
17
17
  import { AtomicText, ScreenLayout, SectionHeader, SectionContainer } from '@umituz/react-native-design-system';
18
18
  import { useLocalization, getLanguageByCode } from '@umituz/react-native-localization';
19
19
  import { SettingItem } from '../components/SettingItem';
@@ -21,7 +21,8 @@ import { SettingItem } from '../components/SettingItem';
21
21
  export const AppearanceScreen: React.FC = () => {
22
22
  const { t, currentLanguage } = useLocalization();
23
23
  const navigation = useNavigation();
24
- const { themeMode, toggleTheme } = useTheme();
24
+ // Only read themeMode, no toggle logic here - theme logic belongs in theme package
25
+ const { themeMode } = useDesignSystemTheme();
25
26
  const tokens = useAppDesignTokens();
26
27
  const styles = getStyles(tokens);
27
28
 
@@ -34,7 +35,13 @@ export const AppearanceScreen: React.FC = () => {
34
35
  };
35
36
 
36
37
  const handleThemeToggle = () => {
37
- toggleTheme();
38
+ // Theme toggle logic should be handled by app, not this package
39
+ // This screen only displays current theme mode
40
+ // App should provide toggle functionality via navigation params or event emitter
41
+ // For now, just navigate back - app can handle toggle in its own theme management
42
+ if (navigation.canGoBack()) {
43
+ navigation.goBack();
44
+ }
38
45
  };
39
46
 
40
47
  return (
@@ -16,7 +16,7 @@ import { DeviceEventEmitter, Alert, View, TouchableOpacity, StyleSheet } from 'r
16
16
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
17
17
 
18
18
  import { useNavigation, CommonActions } from '@react-navigation/native';
19
- import { useTheme, useAppDesignTokens } from '@umituz/react-native-design-system-theme';
19
+ import { useDesignSystemTheme, useAppDesignTokens } from '@umituz/react-native-design-system-theme';
20
20
  import { ScreenLayout, AtomicIcon, AtomicText, SectionHeader, SectionContainer, AtomicDivider } from '@umituz/react-native-design-system';
21
21
  import { SettingItem } from '../components/SettingItem';
22
22
  import { getLanguageByCode, useLocalization } from '@umituz/react-native-localization';
@@ -86,7 +86,8 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
86
86
  config = {}
87
87
  }) => {
88
88
  const navigation = useNavigation();
89
- const { theme, themeMode } = useTheme();
89
+ // Only read themeMode, no theme logic here - theme logic belongs in theme package
90
+ const { themeMode } = useDesignSystemTheme();
90
91
  const tokens = useAppDesignTokens();
91
92
  const insets = useSafeAreaInsets();
92
93
  const { currentLanguage, t } = useLocalization();
@@ -246,12 +247,12 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
246
247
  <View style={[
247
248
  styles.header,
248
249
  {
249
- borderBottomColor: theme.colors.borderLight,
250
- backgroundColor: theme.colors.surface,
250
+ borderBottomColor: tokens.colors.borderLight,
251
+ backgroundColor: tokens.colors.surface,
251
252
  paddingTop: insets.top,
252
253
  }
253
254
  ]}>
254
- <AtomicText type="headlineLarge" style={{ color: theme.colors.textPrimary, flex: 1 }}>
255
+ <AtomicText type="headlineLarge" style={{ color: tokens.colors.textPrimary, flex: 1 }}>
255
256
  {t('navigation.settings') || 'Settings'}
256
257
  </AtomicText>
257
258
  <TouchableOpacity
@@ -270,7 +271,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
270
271
  <SectionHeader>{t('settings.sections.appearance')}</SectionHeader>
271
272
  <SettingItem
272
273
  icon="Palette"
273
- iconGradient={theme.colors.settingGradients.themeLight as unknown as string[]}
274
+ iconGradient={((tokens.colors as any).settingGradients?.themeLight as unknown as string[]) || [tokens.colors.primary, tokens.colors.secondary]}
274
275
  title={t('settings.appearance.title')}
275
276
  description={t('settings.appearance.themeDescription')}
276
277
  onPress={handleAppearancePress}
@@ -285,7 +286,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
285
286
  <SectionHeader>{t('settings.sections.general')}</SectionHeader>
286
287
  <SettingItem
287
288
  icon="Bell"
288
- iconGradient={theme.colors.settingGradients.notifications as unknown as string[]}
289
+ iconGradient={((tokens.colors as any).settingGradients?.notifications as unknown as string[]) || [tokens.colors.primary, tokens.colors.secondary]}
289
290
  title={t('settings.notifications.title')}
290
291
  description={t('settings.notifications.description')}
291
292
  onPress={handleNotificationsPress}
@@ -300,7 +301,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
300
301
  <SectionHeader>Development</SectionHeader>
301
302
  <SettingItem
302
303
  icon="Play"
303
- iconGradient={theme.colors.settingGradients.info as unknown as string[]}
304
+ iconGradient={((tokens.colors as any).settingGradients?.info as unknown as string[]) || [tokens.colors.primary, tokens.colors.secondary]}
304
305
  title="Show Onboarding (Dev)"
305
306
  description="Navigate to onboarding screen"
306
307
  onPress={handleShowOnboarding}
@@ -316,7 +317,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
316
317
  {features.about && (
317
318
  <SettingItem
318
319
  icon="Info"
319
- iconGradient={theme.colors.settingGradients.info as unknown as string[]}
320
+ iconGradient={((tokens.colors as any).settingGradients?.info as unknown as string[]) || [tokens.colors.primary, tokens.colors.secondary]}
320
321
  title={t('settings.about.title')}
321
322
  description={t('settings.about.description')}
322
323
  onPress={handleAboutPress}
@@ -327,7 +328,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
327
328
  {features.legal && (
328
329
  <SettingItem
329
330
  icon="FileText"
330
- iconGradient={theme.colors.settingGradients.info as unknown as string[]}
331
+ iconGradient={((tokens.colors as any).settingGradients?.info as unknown as string[]) || [tokens.colors.primary, tokens.colors.secondary]}
331
332
  title={t('settings.legal.title')}
332
333
  description={t('settings.legal.description')}
333
334
  onPress={handleLegalPress}