@umituz/react-native-settings 4.19.2 → 4.19.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "4.19.2",
3
+ "version": "4.19.3",
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",
@@ -88,4 +88,4 @@
88
88
  "@react-native-firebase/firestore": "^23.7.0",
89
89
  "firebase": "^12.7.0"
90
90
  }
91
- }
91
+ }
@@ -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
- });
@@ -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
  };