@umituz/react-native-settings 4.20.34 → 4.20.36

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.20.34",
3
+ "version": "4.20.36",
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",
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
+ import { useNavigation } from "@react-navigation/native";
3
4
  import { useLocalization } from "@umituz/react-native-localization";
4
5
  import { SettingsFooter } from "../../components/SettingsFooter";
5
6
  import { SettingsSection } from "../../components/SettingsSection";
@@ -13,7 +14,25 @@ import { SettingsItemCard } from "../../components/SettingsItemCard";
13
14
  import type { IconName } from "@umituz/react-native-design-system";
14
15
  import { CustomSettingsList } from "./sections/CustomSettingsList";
15
16
  import type { NormalizedConfig } from "../utils/normalizeConfig";
16
- import type { CustomSettingsSection } from "../types";
17
+ import type { CustomSettingsSection, WalletConfig } from "../types";
18
+
19
+ const WalletSettingsItem: React.FC<{ config: WalletConfig; t: (key: string) => string }> = ({ config, t }) => {
20
+ const navigation = useNavigation();
21
+ const handlePress = () => {
22
+ if (config.route) {
23
+ navigation.navigate(config.route as never);
24
+ }
25
+ };
26
+ return (
27
+ <SettingsItemCard
28
+ title={config.title || t("wallet.title")}
29
+ description={config.description || t("wallet.description")}
30
+ icon={(config.icon || "wallet") as IconName}
31
+ onPress={handlePress}
32
+ sectionTitle={config.sectionTitle}
33
+ />
34
+ );
35
+ };
17
36
 
18
37
  interface SettingsContentProps {
19
38
  normalizedConfig: NormalizedConfig;
@@ -30,6 +49,7 @@ interface SettingsContentProps {
30
49
  rating: boolean;
31
50
  faqs: boolean;
32
51
  subscription: boolean;
52
+ wallet: boolean;
33
53
  };
34
54
  showUserProfile?: boolean;
35
55
  userProfile?: any;
@@ -67,6 +87,7 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
67
87
  features.rating ||
68
88
  features.faqs ||
69
89
  features.subscription ||
90
+ features.wallet ||
70
91
  customSections.length > 0,
71
92
  [features, customSections.length]
72
93
  );
@@ -87,6 +108,13 @@ export const SettingsContent: React.FC<SettingsContentProps> = ({
87
108
  />
88
109
  )}
89
110
 
111
+ {features.wallet && normalizedConfig.wallet.config?.route && (
112
+ <WalletSettingsItem
113
+ config={normalizedConfig.wallet.config}
114
+ t={t}
115
+ />
116
+ )}
117
+
90
118
  <FeatureSettingsSection normalizedConfig={normalizedConfig} features={features} />
91
119
 
92
120
  <IdentitySettingsSection normalizedConfig={normalizedConfig} features={features} />
@@ -59,6 +59,7 @@ export function useFeatureDetection(
59
59
  rating,
60
60
  faqs,
61
61
  subscription,
62
+ wallet,
62
63
  } = normalizedConfig;
63
64
 
64
65
  const notificationServiceAvailable = !!options?.notificationServiceAvailable;
@@ -112,6 +113,7 @@ export function useFeatureDetection(
112
113
  rating: rating.enabled,
113
114
  faqs: faqs.enabled,
114
115
  subscription: subscription.enabled,
116
+ wallet: wallet.enabled,
115
117
  };
116
118
  }, [normalizedConfig, navigation, options]);
117
119
  }
@@ -122,6 +122,12 @@ export interface SettingsConfig {
122
122
  */
123
123
  subscription?: FeatureVisibility | SubscriptionConfig;
124
124
 
125
+ /**
126
+ * Wallet settings configuration
127
+ * @default false
128
+ */
129
+ wallet?: FeatureVisibility | WalletConfig;
130
+
125
131
  /**
126
132
  * Custom empty state text when no settings are available
127
133
  */
@@ -17,6 +17,7 @@ export type {
17
17
  FAQConfig,
18
18
  SubscriptionConfig,
19
19
  CloudSyncConfig,
20
+ WalletConfig,
20
21
  } from "./FeatureConfig";
21
22
  export type { SettingsConfig } from "./SettingsConfig";
22
23
  export type { CustomSettingsSection } from "./CustomSection";
@@ -16,6 +16,7 @@ import type {
16
16
  RatingConfig,
17
17
  FAQConfig,
18
18
  SubscriptionConfig,
19
+ WalletConfig,
19
20
  SettingsConfig,
20
21
  } from "../types";
21
22
 
@@ -64,6 +65,10 @@ export interface NormalizedConfig {
64
65
  enabled: boolean;
65
66
  config?: SubscriptionConfig;
66
67
  };
68
+ wallet: {
69
+ enabled: boolean;
70
+ config?: WalletConfig;
71
+ };
67
72
  }
68
73
 
69
74
  /**
@@ -109,5 +114,6 @@ export function normalizeSettingsConfig(
109
114
  rating: normalizeConfigValue(config?.rating, false),
110
115
  faqs: normalizeConfigValue(config?.faqs, false),
111
116
  subscription: normalizeConfigValue(config?.subscription, false),
117
+ wallet: normalizeConfigValue(config?.wallet, false),
112
118
  };
113
119
  }
@@ -1,82 +0,0 @@
1
- /**
2
- * Account Screen
3
- * User account management screen
4
- */
5
-
6
- import React from "react";
7
- import { View, ScrollView, StyleSheet } from "react-native";
8
- import { useSafeAreaInsets } from "react-native-safe-area-context";
9
- import { useAppDesignTokens } from "@umituz/react-native-design-system";
10
- import { SettingsSection } from "../components/SettingsSection";
11
- import { SettingsItem } from "../components/SettingsItem";
12
-
13
- export interface AccountScreenConfig {
14
- readonly onDeleteAccount?: () => void | Promise<void>;
15
- readonly onSignOut?: () => void | Promise<void>;
16
- readonly showDeleteAccount?: boolean;
17
- readonly showSignOut?: boolean;
18
- readonly t: (key: string) => string;
19
- }
20
-
21
- interface AccountScreenProps {
22
- readonly config: AccountScreenConfig;
23
- }
24
-
25
- export const AccountScreen: React.FC<AccountScreenProps> = ({ config }) => {
26
- const insets = useSafeAreaInsets();
27
- const tokens = useAppDesignTokens();
28
-
29
- const {
30
- onDeleteAccount,
31
- onSignOut,
32
- showDeleteAccount = true,
33
- showSignOut = true,
34
- t,
35
- } = config;
36
-
37
- return (
38
- <View
39
- style={[
40
- styles.container,
41
- { backgroundColor: tokens.colors.background },
42
- ]}
43
- >
44
- <ScrollView
45
- contentContainerStyle={[
46
- styles.content,
47
- { paddingBottom: insets.bottom + 24 },
48
- ]}
49
- showsVerticalScrollIndicator={false}
50
- >
51
- <SettingsSection title={t("settings.account.title")}>
52
- {showSignOut && onSignOut && (
53
- <SettingsItem
54
- label={t("auth.signOut")}
55
- icon="log-out-outline"
56
- onPress={onSignOut}
57
- variant="default"
58
- />
59
- )}
60
-
61
- {showDeleteAccount && onDeleteAccount && (
62
- <SettingsItem
63
- label={t("account.deleteAccount")}
64
- icon="trash-outline"
65
- onPress={onDeleteAccount}
66
- variant="destructive"
67
- />
68
- )}
69
- </SettingsSection>
70
- </ScrollView>
71
- </View>
72
- );
73
- };
74
-
75
- const styles = StyleSheet.create({
76
- container: {
77
- flex: 1,
78
- },
79
- content: {
80
- paddingTop: 16,
81
- },
82
- });