@umituz/react-native-settings 4.16.21 → 4.17.0
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 +3 -4
- package/src/presentation/components/CloudSyncSetting.tsx +2 -1
- package/src/presentation/components/DevSettingsSection.tsx +7 -1
- package/src/presentation/components/SettingItem.tsx +10 -6
- package/src/presentation/components/SettingsErrorBoundary.tsx +5 -10
- package/src/presentation/components/StorageClearSetting.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"typecheck": "
|
|
9
|
-
"lint": "
|
|
10
|
-
"version:patch": "npm version patch -m 'chore: release v%s'",
|
|
8
|
+
"typecheck": "tsc --noEmit",
|
|
9
|
+
"lint": "tsc --noEmit",
|
|
11
10
|
"version:minor": "npm version minor -m 'chore: release v%s'",
|
|
12
11
|
"version:major": "npm version major -m 'chore: release v%s'"
|
|
13
12
|
},
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React, { useCallback } from "react";
|
|
7
|
+
import { Feather } from "@expo/vector-icons";
|
|
7
8
|
import { SettingItem } from "./SettingItem";
|
|
8
9
|
import type { SettingItemProps } from "./SettingItem";
|
|
9
10
|
|
|
@@ -45,7 +46,7 @@ export const CloudSyncSetting: React.FC<CloudSyncSettingProps> = ({
|
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<SettingItem
|
|
48
|
-
icon="cloud
|
|
49
|
+
icon={(props) => <Feather name={"cloud" as any} {...props} />}
|
|
49
50
|
title={title || "cloud_sync"}
|
|
50
51
|
value={displayDescription}
|
|
51
52
|
onPress={onPress}
|
|
@@ -9,11 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
import React from "react";
|
|
11
11
|
import { Alert } from "react-native";
|
|
12
|
+
import { Feather } from "@expo/vector-icons";
|
|
12
13
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
13
14
|
import { storageRepository } from "@umituz/react-native-storage";
|
|
14
15
|
import { SettingsSection } from "./SettingsSection";
|
|
15
16
|
import { SettingItem } from "./SettingItem";
|
|
16
17
|
|
|
18
|
+
// Icon wrapper for SettingItem compatibility
|
|
19
|
+
const TrashIcon: React.FC<{ size?: number; color?: string }> = ({ size = 24, color }) => (
|
|
20
|
+
<Feather name="trash-2" size={size} color={color} />
|
|
21
|
+
);
|
|
22
|
+
|
|
17
23
|
// Default texts (English only - DEV feature)
|
|
18
24
|
const DEFAULT_TEXTS = {
|
|
19
25
|
sectionTitle: "Developer",
|
|
@@ -101,7 +107,7 @@ export const DevSettingsSection: React.FC<DevSettingsProps> = ({
|
|
|
101
107
|
<SettingsSection title={t.sectionTitle}>
|
|
102
108
|
{customDevComponents.map((component) => component)}
|
|
103
109
|
<SettingItem
|
|
104
|
-
icon=
|
|
110
|
+
icon={TrashIcon}
|
|
105
111
|
title={t.clearTitle}
|
|
106
112
|
value={t.clearDescription}
|
|
107
113
|
onPress={handleClearData}
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, Pressable, StyleSheet, Switch } from "react-native";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
AtomicIcon,
|
|
11
|
+
useAppDesignTokens,
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
10
13
|
|
|
11
14
|
export interface SettingItemProps {
|
|
12
|
-
/** Icon name
|
|
15
|
+
/** Icon name for AtomicIcon */
|
|
13
16
|
icon: string;
|
|
14
17
|
/** Main title text */
|
|
15
18
|
title: string;
|
|
@@ -60,6 +63,7 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
60
63
|
}) => {
|
|
61
64
|
const tokens = useAppDesignTokens();
|
|
62
65
|
const colors = tokens.colors;
|
|
66
|
+
const spacing = tokens.spacing;
|
|
63
67
|
|
|
64
68
|
return (
|
|
65
69
|
<>
|
|
@@ -89,7 +93,7 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
89
93
|
>
|
|
90
94
|
<AtomicIcon
|
|
91
95
|
name={icon}
|
|
92
|
-
|
|
96
|
+
size={24}
|
|
93
97
|
customColor={iconColor || colors.primary}
|
|
94
98
|
/>
|
|
95
99
|
</View>
|
|
@@ -128,13 +132,13 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
128
132
|
false: `${colors.textSecondary}30`,
|
|
129
133
|
true: colors.primary,
|
|
130
134
|
}}
|
|
131
|
-
thumbColor={switchThumbColor || "#FFFFFF"}
|
|
135
|
+
thumbColor={switchThumbColor || colors.onPrimary || "#FFFFFF"}
|
|
132
136
|
ios_backgroundColor={`${colors.textSecondary}30`}
|
|
133
137
|
/>
|
|
134
138
|
) : (
|
|
135
139
|
<AtomicIcon
|
|
136
|
-
name="chevron-
|
|
137
|
-
|
|
140
|
+
name="chevron-right"
|
|
141
|
+
size={20}
|
|
138
142
|
customColor={colors.textSecondary}
|
|
139
143
|
/>
|
|
140
144
|
)}
|
|
@@ -7,7 +7,6 @@ import React, { Component, ReactNode } from 'react';
|
|
|
7
7
|
import { View, StyleSheet } from 'react-native';
|
|
8
8
|
import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
9
9
|
import { AtomicText, AtomicIcon } from '@umituz/react-native-design-system';
|
|
10
|
-
import { useLocalization } from '@umituz/react-native-localization';
|
|
11
10
|
|
|
12
11
|
interface Props {
|
|
13
12
|
children: ReactNode;
|
|
@@ -64,19 +63,15 @@ interface ErrorBoundaryFallbackProps {
|
|
|
64
63
|
|
|
65
64
|
const ErrorBoundaryFallback: React.FC<ErrorBoundaryFallbackProps> = ({
|
|
66
65
|
error,
|
|
67
|
-
fallbackTitle,
|
|
68
|
-
fallbackMessage
|
|
66
|
+
fallbackTitle = "error_boundary.title",
|
|
67
|
+
fallbackMessage = "error_boundary.message"
|
|
69
68
|
}) => {
|
|
70
69
|
const tokens = useAppDesignTokens();
|
|
71
|
-
const { t } = useLocalization();
|
|
72
|
-
|
|
73
|
-
const title = __DEV__ && error?.message
|
|
74
|
-
? t("error_boundary.dev_title")
|
|
75
|
-
: (fallbackTitle || t("error_boundary.title"));
|
|
76
70
|
|
|
71
|
+
const title = __DEV__ && error?.message ? "error_boundary.dev_title" : fallbackTitle;
|
|
77
72
|
const message = __DEV__ && error?.message
|
|
78
|
-
?
|
|
79
|
-
:
|
|
73
|
+
? `error_boundary.dev_message: ${error.message}`
|
|
74
|
+
: fallbackMessage;
|
|
80
75
|
|
|
81
76
|
return (
|
|
82
77
|
<View style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { Feather } from "@expo/vector-icons";
|
|
8
9
|
import { SettingItem } from "./SettingItem";
|
|
9
10
|
|
|
10
11
|
export interface StorageClearSettingProps {
|
|
@@ -36,7 +37,7 @@ export const StorageClearSetting: React.FC<StorageClearSettingProps> = ({
|
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
39
|
<SettingItem
|
|
39
|
-
icon="trash-
|
|
40
|
+
icon={(props) => <Feather name={"trash-2" as any} {...props} />}
|
|
40
41
|
title={defaultTitle}
|
|
41
42
|
value={defaultDescription}
|
|
42
43
|
onPress={onPress}
|