@umituz/react-native-settings 4.19.2 → 4.19.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "4.19.2",
3
+ "version": "4.19.4",
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",
@@ -55,8 +55,13 @@
55
55
  "devDependencies": {
56
56
  "@babel/plugin-transform-runtime": "^7.28.5",
57
57
  "@expo/vector-icons": "^15.0.0",
58
+ "@gorhom/bottom-sheet": "^5.2.8",
59
+ "@react-native-community/datetimepicker": "^8.5.1",
60
+ "@react-navigation/bottom-tabs": "^7.9.0",
58
61
  "@react-navigation/native": "^6.1.18",
59
62
  "@react-navigation/stack": "^6.4.1",
63
+ "@sentry/react-native": "^7.8.0",
64
+ "@sentry/types": "^10.32.1",
60
65
  "@tanstack/react-query": "^5.0.0",
61
66
  "@types/jest": "^29.5.14",
62
67
  "@types/react": "~19.1.10",
@@ -64,15 +69,40 @@
64
69
  "@typescript-eslint/parser": "^7.0.0",
65
70
  "@umituz/react-native-auth": "latest",
66
71
  "@umituz/react-native-design-system": "latest",
72
+ "@umituz/react-native-filesystem": "^2.1.7",
73
+ "@umituz/react-native-firebase": "^1.13.28",
74
+ "@umituz/react-native-haptics": "^1.0.3",
67
75
  "@umituz/react-native-localization": "latest",
68
76
  "@umituz/react-native-notifications": "latest",
69
77
  "@umituz/react-native-onboarding": "latest",
78
+ "@umituz/react-native-sentry": "^1.4.2",
70
79
  "@umituz/react-native-storage": "latest",
71
80
  "@umituz/react-native-tanstack": "latest",
81
+ "@umituz/react-native-uuid": "^1.2.2",
72
82
  "eslint": "^8.57.0",
83
+ "expo-apple-authentication": "^8.0.8",
84
+ "expo-application": "^7.0.8",
85
+ "expo-clipboard": "^8.0.8",
86
+ "expo-crypto": "^15.0.8",
87
+ "expo-device": "^8.0.10",
88
+ "expo-file-system": "^19.0.21",
89
+ "expo-haptics": "^15.0.8",
90
+ "expo-image": "^3.0.11",
91
+ "expo-linear-gradient": "^15.0.8",
92
+ "expo-localization": "^17.0.8",
93
+ "expo-notifications": "^0.32.15",
94
+ "expo-sharing": "^14.0.8",
95
+ "expo-video": "^3.0.15",
96
+ "i18next": "^25.7.3",
73
97
  "react": "19.1.0",
98
+ "react-i18next": "^16.5.0",
74
99
  "react-native": "0.81.5",
75
- "typescript": "^5.3.0"
100
+ "react-native-gesture-handler": "^2.30.0",
101
+ "react-native-reanimated": "^4.2.1",
102
+ "react-native-safe-area-context": "^5.6.2",
103
+ "rn-emoji-keyboard": "^1.7.0",
104
+ "typescript": "^5.3.0",
105
+ "zustand": "^5.0.9"
76
106
  },
77
107
  "publishConfig": {
78
108
  "access": "public"
@@ -88,4 +118,4 @@
88
118
  "@react-native-firebase/firestore": "^23.7.0",
89
119
  "firebase": "^12.7.0"
90
120
  }
91
- }
121
+ }
@@ -1,12 +1,8 @@
1
1
  import React from 'react';
2
- import { View, StyleSheet, ViewStyle } from 'react-native';
2
+ import { ViewStyle } from 'react-native';
3
3
  import { useNavigation } from '@react-navigation/native';
4
- import {
5
- useResponsiveDesignTokens,
6
- AtomicText,
7
- ListItem
8
- } from '@umituz/react-native-design-system';
9
4
  import { AboutConfig } from '../../domain/entities/AppInfo';
5
+ import { SettingsItemCard } from '../../../../presentation/components/SettingsItemCard';
10
6
 
11
7
  export interface AboutSectionProps {
12
8
  config?: AboutConfig;
@@ -26,12 +22,11 @@ export const AboutSection: React.FC<AboutSectionProps> = ({
26
22
  sectionTitle: propsSectionTitle,
27
23
  }) => {
28
24
  const navigation = useNavigation();
29
- const tokens = useResponsiveDesignTokens();
30
25
 
31
26
  const route = config?.route || config?.defaultRoute || 'About';
32
27
  const title = propsTitle || config?.title;
33
28
  const description = propsDescription || config?.description;
34
- const sectionTitle = propsSectionTitle || title;
29
+ const sectionTitle = propsSectionTitle;
35
30
 
36
31
  const handlePress = () => {
37
32
  if (onPress) {
@@ -44,34 +39,13 @@ export const AboutSection: React.FC<AboutSectionProps> = ({
44
39
  if (!title) return null;
45
40
 
46
41
  return (
47
- <View style={[styles.sectionContainer, { backgroundColor: tokens.colors.surface }, containerStyle]}>
48
- {!!sectionTitle && (
49
- <View style={styles.headerContainer}>
50
- <AtomicText type="titleMedium" color="primary">
51
- {sectionTitle}
52
- </AtomicText>
53
- </View>
54
- )}
55
- <ListItem
56
- title={title}
57
- subtitle={description}
58
- leftIcon="information-circle"
59
- rightIcon="chevron-forward"
60
- onPress={handlePress}
61
- />
62
- </View>
42
+ <SettingsItemCard
43
+ title={title}
44
+ description={description}
45
+ icon="information-circle-outline"
46
+ onPress={handlePress}
47
+ containerStyle={containerStyle}
48
+ sectionTitle={sectionTitle}
49
+ />
63
50
  );
64
51
  };
65
-
66
- const styles = StyleSheet.create({
67
- sectionContainer: {
68
- marginBottom: 16,
69
- borderRadius: 12,
70
- overflow: 'hidden',
71
- },
72
- headerContainer: {
73
- paddingHorizontal: 16,
74
- paddingTop: 16,
75
- paddingBottom: 8,
76
- },
77
- });
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { View, Pressable, StyleSheet, ViewStyle } from 'react-native';
2
+ import { ViewStyle } from 'react-native';
3
3
  import { useNavigation } from '@react-navigation/native';
4
- import { useResponsiveDesignTokens, AtomicIcon, AtomicText } from '@umituz/react-native-design-system';
5
4
  import { LegalConfig } from '../../domain/entities/LegalConfig';
5
+ import { SettingsItemCard } from '../../../../presentation/components/SettingsItemCard';
6
6
 
7
7
  export interface LegalSectionProps {
8
8
  config?: LegalConfig;
@@ -22,13 +22,11 @@ export const LegalSection: React.FC<LegalSectionProps> = ({
22
22
  sectionTitle: propsSectionTitle,
23
23
  }) => {
24
24
  const navigation = useNavigation();
25
- const tokens = useResponsiveDesignTokens();
26
- const colors = tokens.colors;
27
25
 
28
26
  const route = config?.route || config?.defaultRoute || 'Legal';
29
27
  const title = propsTitle || config?.title;
30
28
  const description = propsDescription || config?.description;
31
- const sectionTitle = propsSectionTitle || title;
29
+ const sectionTitle = propsSectionTitle;
32
30
 
33
31
  const handlePress = () => {
34
32
  if (onPress) {
@@ -41,94 +39,13 @@ export const LegalSection: React.FC<LegalSectionProps> = ({
41
39
  if (!title) return null;
42
40
 
43
41
  return (
44
- <View style={[styles.sectionContainer, { backgroundColor: colors.surface }, containerStyle]}>
45
- {!!sectionTitle && (
46
- <View style={styles.headerContainer}>
47
- <AtomicText
48
- type="titleMedium"
49
- color="primary"
50
- >
51
- {sectionTitle}
52
- </AtomicText>
53
- </View>
54
- )}
55
- <Pressable
56
- style={({ pressed }) => [
57
- styles.itemContainer,
58
- {
59
- backgroundColor: pressed ? `${colors.primary}08` : 'transparent',
60
- },
61
- ]}
62
- onPress={handlePress}
63
- >
64
- <View style={styles.content}>
65
- <View
66
- style={[
67
- styles.iconContainer,
68
- { backgroundColor: `${colors.primary}15` },
69
- ]}
70
- >
71
- <AtomicIcon name="document-text" size="lg" color="primary" />
72
- </View>
73
- <View style={styles.textContainer}>
74
- <AtomicText
75
- type="bodyLarge"
76
- color="primary"
77
- numberOfLines={1}
78
- style={{ marginBottom: 4 }}
79
- >
80
- {title}
81
- </AtomicText>
82
- {!!description && (
83
- <AtomicText
84
- type="bodyMedium"
85
- color="secondary"
86
- numberOfLines={2}
87
- >
88
- {description}
89
- </AtomicText>
90
- )}
91
- </View>
92
- <AtomicIcon name="chevron-forward" size="md" color="secondary" />
93
- </View>
94
- </Pressable>
95
- </View>
42
+ <SettingsItemCard
43
+ title={title}
44
+ description={description}
45
+ icon="document-text-outline"
46
+ onPress={handlePress}
47
+ containerStyle={containerStyle}
48
+ sectionTitle={sectionTitle}
49
+ />
96
50
  );
97
51
  };
98
-
99
- const styles = StyleSheet.create({
100
- sectionContainer: {
101
- marginBottom: 16,
102
- borderRadius: 12,
103
- overflow: 'hidden',
104
- },
105
- headerContainer: {
106
- paddingHorizontal: 16,
107
- paddingTop: 16,
108
- paddingBottom: 8,
109
- },
110
- itemContainer: {
111
- flexDirection: 'row',
112
- alignItems: 'center',
113
- paddingHorizontal: 16,
114
- paddingVertical: 16,
115
- minHeight: 72,
116
- },
117
- content: {
118
- flex: 1,
119
- flexDirection: 'row',
120
- alignItems: 'center',
121
- },
122
- iconContainer: {
123
- width: 48,
124
- height: 48,
125
- borderRadius: 12,
126
- justifyContent: 'center',
127
- alignItems: 'center',
128
- marginRight: 16,
129
- },
130
- textContainer: {
131
- flex: 1,
132
- marginRight: 8,
133
- },
134
- });
package/src/index.ts CHANGED
@@ -86,6 +86,9 @@ export { SettingsErrorBoundary } from './presentation/components/SettingsErrorBo
86
86
  export { StorageClearSetting } from './presentation/components/StorageClearSetting';
87
87
  export type { StorageClearSettingProps } from './presentation/components/StorageClearSetting';
88
88
 
89
+ export { CloudSyncSetting } from './presentation/components/CloudSyncSetting';
90
+ export type { CloudSyncSettingProps } from './presentation/components/CloudSyncSetting';
91
+
89
92
  export { DevSettingsSection } from './presentation/components/DevSettingsSection';
90
93
  export type { DevSettingsProps } from './presentation/components/DevSettingsSection';
91
94
 
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Cloud Sync Setting Component
3
+ * Displays cloud sync status and allows triggering sync
4
+ */
5
+
6
+ import React, { useMemo } from "react";
7
+ import { SettingItem } from "./SettingItem";
8
+
9
+ export interface CloudSyncSettingProps {
10
+ title?: string;
11
+ description?: string;
12
+ isSyncing?: boolean;
13
+ lastSynced?: Date | null;
14
+ onPress?: () => void;
15
+ disabled?: boolean;
16
+ isLast?: boolean;
17
+ }
18
+
19
+ const formatLastSynced = (date: Date): string => {
20
+ const now = new Date();
21
+ const diffMs = now.getTime() - date.getTime();
22
+ const diffMinutes = Math.floor(diffMs / (1000 * 60));
23
+ const diffHours = Math.floor(diffMinutes / 60);
24
+ const diffDays = Math.floor(diffHours / 24);
25
+
26
+ if (diffMinutes < 1) {
27
+ return "last_synced_just_now";
28
+ }
29
+ if (diffMinutes < 60) {
30
+ return `last_synced_${diffMinutes}m_ago`;
31
+ }
32
+ if (diffHours < 24) {
33
+ return `last_synced_${diffHours}h_ago`;
34
+ }
35
+ return `last_synced_${diffDays}d_ago`;
36
+ };
37
+
38
+ export const CloudSyncSetting: React.FC<CloudSyncSettingProps> = ({
39
+ title = "cloud_sync",
40
+ description,
41
+ isSyncing = false,
42
+ lastSynced,
43
+ onPress,
44
+ disabled = false,
45
+ isLast = false,
46
+ }) => {
47
+ const displayValue = useMemo(() => {
48
+ if (isSyncing) {
49
+ return "syncing";
50
+ }
51
+ if (description) {
52
+ return description;
53
+ }
54
+ if (lastSynced) {
55
+ return formatLastSynced(lastSynced);
56
+ }
57
+ return undefined;
58
+ }, [isSyncing, description, lastSynced]);
59
+
60
+ return (
61
+ <SettingItem
62
+ icon="cloud"
63
+ title={title}
64
+ value={displayValue}
65
+ onPress={onPress}
66
+ disabled={disabled || isSyncing}
67
+ isLast={isLast}
68
+ />
69
+ );
70
+ };
@@ -4,8 +4,8 @@ import {
4
4
  AtomicIcon,
5
5
  AtomicText,
6
6
  useResponsiveDesignTokens,
7
- ListItem
8
7
  } from "@umituz/react-native-design-system";
8
+ import { SettingsItemCard } from "./SettingsItemCard";
9
9
 
10
10
  export interface SettingItemProps {
11
11
  icon: string;
@@ -104,19 +104,14 @@ export const SettingItem: React.FC<SettingItemProps> = ({
104
104
  );
105
105
  }
106
106
 
107
- // Use design system's ListItem for regular items
107
+ // Use SettingsItemCard for regular items
108
108
  return (
109
- <ListItem
109
+ <SettingsItemCard
110
110
  title={title}
111
- subtitle={value}
112
- leftIcon={icon}
113
- rightIcon="chevron-forward"
114
- onPress={onPress}
115
- disabled={disabled}
116
- style={{
117
- borderBottomWidth: isLast ? 0 : 1,
118
- borderBottomColor: `${tokens.colors.onSurface}10`,
119
- }}
111
+ description={value}
112
+ icon={icon as any}
113
+ onPress={onPress || (() => { })}
114
+ iconColor={iconColor}
120
115
  />
121
116
  );
122
117
  };