@umituz/react-native-settings 4.20.20 → 4.20.21

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.20",
3
+ "version": "4.20.21",
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 { SettingsSection } from "../../../components/SettingsSection";
3
+ import { SettingsItemCard } from "../../../components/SettingsItemCard";
3
4
  import type { CustomSettingsSection } from "../../types";
4
5
 
5
6
  interface CustomSettingsListProps {
@@ -24,6 +25,18 @@ export const CustomSettingsList: React.FC<CustomSettingsListProps> = ({
24
25
  title={section.title}
25
26
  >
26
27
  {section.content}
28
+ {!section.content && section.items?.map((item) => (
29
+ <SettingsItemCard
30
+ key={item.id}
31
+ title={item.title}
32
+ description={item.subtitle}
33
+ icon={item.icon}
34
+ onPress={item.onPress}
35
+ rightIcon={item.rightIcon}
36
+ iconBgColor={item.iconBgColor}
37
+ iconColor={item.iconColor}
38
+ />
39
+ ))}
27
40
  </SettingsSection>
28
41
  ))}
29
42
  </>
@@ -1,9 +1,27 @@
1
+ import type { ReactNode } from "react";
2
+ import type { IconName } from "@umituz/react-native-design-system";
3
+
1
4
  /**
2
- * Custom Settings Section Type
3
- * Allows apps to add custom sections to the settings screen
5
+ * Custom Settings Item
4
6
  */
5
-
6
- import type { ReactNode } from "react";
7
+ export interface CustomSettingsItem {
8
+ /** Item unique ID */
9
+ id: string;
10
+ /** Item title */
11
+ title: string;
12
+ /** Optional subtitle or description */
13
+ subtitle?: string;
14
+ /** Icon name (Ionicons) */
15
+ icon: IconName;
16
+ /** Press handler */
17
+ onPress: () => void;
18
+ /** Optional right icon (Ionicons) */
19
+ rightIcon?: IconName;
20
+ /** Optional icon color */
21
+ iconColor?: string;
22
+ /** Optional icon background color */
23
+ iconBgColor?: string;
24
+ }
7
25
 
8
26
  /**
9
27
  * Custom Settings Section
@@ -11,8 +29,10 @@ import type { ReactNode } from "react";
11
29
  export interface CustomSettingsSection {
12
30
  /** Section title */
13
31
  title: string;
14
- /** Section content (React nodes) */
15
- content: ReactNode;
32
+ /** Section content (React nodes) - takes priority over items */
33
+ content?: ReactNode;
34
+ /** List of settings items to render */
35
+ items?: CustomSettingsItem[];
16
36
  /** Section order (lower = higher in list) */
17
37
  order?: number;
18
38
  /** Section ID for identification */