@umituz/react-native-settings 4.16.3 → 4.16.5

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.16.3",
3
+ "version": "4.16.5",
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",
@@ -30,6 +30,7 @@
30
30
  "@react-navigation/native": ">=6.0.0",
31
31
  "@react-navigation/stack": ">=6.0.0",
32
32
  "@umituz/react-native-about": "^1.11.3",
33
+ "@umituz/react-native-avatar": "*",
33
34
  "@umituz/react-native-appearance": "*",
34
35
  "@umituz/react-native-design-system": "*",
35
36
  "@umituz/react-native-design-system-atoms": "*",
@@ -40,8 +41,9 @@
40
41
  "@umituz/react-native-design-system-typography": "*",
41
42
  "@umituz/react-native-legal": "*",
42
43
  "@umituz/react-native-localization": "*",
43
- "@umituz/react-native-storage": "*",
44
44
  "@umituz/react-native-notifications": "*",
45
+ "@umituz/react-native-onboarding": "*",
46
+ "@umituz/react-native-storage": "*",
45
47
  "react": ">=18.2.0",
46
48
  "react-native": ">=0.74.0",
47
49
  "react-native-safe-area-context": "~5.6.0",
@@ -63,6 +65,7 @@
63
65
  "@umituz/react-native-about": "^1.11.4",
64
66
  "@umituz/react-native-alert": "latest",
65
67
  "@umituz/react-native-appearance": "^2.0.2",
68
+ "@umituz/react-native-avatar": "latest",
66
69
  "@umituz/react-native-design-system": "latest",
67
70
  "@umituz/react-native-design-system-atoms": "latest",
68
71
  "@umituz/react-native-design-system-molecules": "latest",
@@ -73,6 +76,7 @@
73
76
  "@umituz/react-native-legal": "^2.0.3",
74
77
  "@umituz/react-native-localization": "latest",
75
78
  "@umituz/react-native-notifications": "latest",
79
+ "@umituz/react-native-onboarding": "^3.3.0",
76
80
  "@umituz/react-native-storage": "latest",
77
81
  "babel-plugin-module-resolver": "^5.0.2",
78
82
  "expo-constants": "^18.0.12",
package/src/index.ts CHANGED
@@ -83,3 +83,14 @@ export type { StorageClearSettingProps } from './presentation/components/Storage
83
83
  export { DevSettingsSection } from './presentation/components/DevSettingsSection';
84
84
  export type { DevSettingsProps } from './presentation/components/DevSettingsSection';
85
85
 
86
+ // =============================================================================
87
+ // PRESENTATION LAYER - Re-exports from Dependencies
88
+ // =============================================================================
89
+
90
+ // @ts-ignore - Re-exporting from peer dependency
91
+ export { OnboardingResetSetting } from '@umituz/react-native-onboarding';
92
+ // @ts-ignore - Re-exporting from peer dependency
93
+ export type { OnboardingResetSettingProps } from '@umituz/react-native-onboarding';
94
+
95
+
96
+
@@ -38,11 +38,11 @@ const DEFAULT_TEXTS = {
38
38
  export interface DevSettingsProps {
39
39
  /** Enable dev settings section (default: true in __DEV__ mode) */
40
40
  enabled?: boolean;
41
- /** Callback after storage is cleared - use this to reload the app */
41
+ /** Callback after storage is cleared - use this to reload the app and reset app state (e.g., onboarding) */
42
42
  onAfterClear?: () => Promise<void>;
43
43
  /** Custom texts (optional - defaults to English) */
44
44
  texts?: Partial<typeof DEFAULT_TEXTS>;
45
- /** Custom dev components to render before the clear data button */
45
+ /** Custom dev components to render BEFORE the "Clear All Data" button (e.g., OnboardingResetSetting) */
46
46
  customDevComponents?: React.ReactNode[];
47
47
  }
48
48
 
@@ -4,12 +4,13 @@
4
4
  * Works for both guest and authenticated users
5
5
  */
6
6
 
7
- import React, { useState, useCallback } from "react";
8
- import { View, TouchableOpacity, StyleSheet, Image } from "react-native";
7
+ import React, { useCallback } from "react";
8
+ import { View, TouchableOpacity, StyleSheet } from "react-native";
9
9
  import { Feather } from "@expo/vector-icons";
10
10
  import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
11
11
  import { AtomicText } from "@umituz/react-native-design-system-atoms";
12
12
  import { useNavigation } from "@react-navigation/native";
13
+ import { Avatar } from "@umituz/react-native-avatar";
13
14
 
14
15
  export interface UserProfileHeaderProps {
15
16
  /** User display name */
@@ -50,16 +51,9 @@ export const UserProfileHeader: React.FC<UserProfileHeaderProps> = ({
50
51
  const navigation = useNavigation();
51
52
  const colors = tokens.colors;
52
53
  const spacing = tokens.spacing;
53
- const [imageError, setImageError] = useState(false);
54
-
55
54
  const finalDisplayName = displayName || (isAnonymous ? anonymousDisplayName || defaultAnonymousDisplayName || "Anonymous" : defaultUserDisplayName || "User");
56
55
  const avatarName = isAnonymous ? anonymousDisplayName || defaultAnonymousDisplayName || "Anonymous" : finalDisplayName;
57
56
 
58
- const defaultAvatarService = avatarServiceUrl || "https://ui-avatars.com/api";
59
- const finalAvatarUrl =
60
- (imageError ? null : avatarUrl) ||
61
- `${defaultAvatarService}/?name=${encodeURIComponent(avatarName)}&background=${colors.primary.replace("#", "")}&color=fff&size=64`;
62
-
63
57
  const handlePress = useCallback(() => {
64
58
  if (onPress) {
65
59
  onPress();
@@ -84,24 +78,13 @@ export const UserProfileHeader: React.FC<UserProfileHeaderProps> = ({
84
78
  const content = (
85
79
  <>
86
80
  <View style={styles.content}>
87
- <View style={[styles.avatarContainer, { borderColor: `${colors.primary}30` }]}>
88
- {finalAvatarUrl ? (
89
- <Image
90
- source={{ uri: finalAvatarUrl }}
91
- style={styles.avatar}
92
- onError={() => setImageError(true)}
93
- />
94
- ) : (
95
- <View style={[styles.avatarFallback, { backgroundColor: `${colors.primary}20` }]}>
96
- <AtomicText
97
- type="headlineMedium"
98
- color="primary"
99
- style={styles.avatarText}
100
- >
101
- {avatarName.charAt(0).toUpperCase()}
102
- </AtomicText>
103
- </View>
104
- )}
81
+ <View style={styles.avatarContainer}>
82
+ <Avatar
83
+ uri={avatarUrl}
84
+ name={avatarName}
85
+ size="lg"
86
+ shape="circle"
87
+ />
105
88
  </View>
106
89
  <View style={[styles.textContainer, { marginLeft: spacing.md }]}>
107
90
  <AtomicText
@@ -161,26 +144,9 @@ const styles = StyleSheet.create({
161
144
  flex: 1,
162
145
  },
163
146
  avatarContainer: {
164
- width: 64,
165
- height: 64,
166
- borderRadius: 32,
167
- borderWidth: 2,
168
- overflow: "hidden",
169
- backgroundColor: "transparent",
170
- },
171
- avatar: {
172
- width: "100%",
173
- height: "100%",
174
- },
175
- avatarFallback: {
176
- width: "100%",
177
- height: "100%",
178
147
  justifyContent: "center",
179
148
  alignItems: "center",
180
149
  },
181
- avatarText: {
182
- fontWeight: "700",
183
- },
184
150
  textContainer: {
185
151
  flex: 1,
186
152
  },