@umituz/react-native-settings 4.16.18 → 4.16.20
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
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, Pressable, StyleSheet, Switch } from "react-native";
|
|
9
|
-
import {
|
|
10
|
-
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
|
+
import { AtomicIcon, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
11
10
|
|
|
12
11
|
export interface SettingItemProps {
|
|
13
|
-
/** Icon
|
|
14
|
-
icon:
|
|
12
|
+
/** Icon name (Ionicons) */
|
|
13
|
+
icon: string;
|
|
15
14
|
/** Main title text */
|
|
16
15
|
title: string;
|
|
17
16
|
/** Optional description/value text */
|
|
@@ -44,7 +43,7 @@ export interface SettingItemProps {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
export const SettingItem: React.FC<SettingItemProps> = ({
|
|
47
|
-
icon
|
|
46
|
+
icon,
|
|
48
47
|
title,
|
|
49
48
|
value,
|
|
50
49
|
onPress,
|
|
@@ -61,7 +60,6 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
61
60
|
}) => {
|
|
62
61
|
const tokens = useAppDesignTokens();
|
|
63
62
|
const colors = tokens.colors;
|
|
64
|
-
const spacing = tokens.spacing;
|
|
65
63
|
|
|
66
64
|
return (
|
|
67
65
|
<>
|
|
@@ -89,7 +87,11 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
89
87
|
},
|
|
90
88
|
]}
|
|
91
89
|
>
|
|
92
|
-
<
|
|
90
|
+
<AtomicIcon
|
|
91
|
+
name={icon}
|
|
92
|
+
customSize={24}
|
|
93
|
+
customColor={iconColor || colors.primary}
|
|
94
|
+
/>
|
|
93
95
|
</View>
|
|
94
96
|
<View style={styles.textContainer}>
|
|
95
97
|
<Text
|
|
@@ -130,7 +132,11 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
130
132
|
ios_backgroundColor={`${colors.textSecondary}30`}
|
|
131
133
|
/>
|
|
132
134
|
) : (
|
|
133
|
-
<
|
|
135
|
+
<AtomicIcon
|
|
136
|
+
name="chevron-forward-outline"
|
|
137
|
+
customSize={20}
|
|
138
|
+
customColor={colors.textSecondary}
|
|
139
|
+
/>
|
|
134
140
|
)}
|
|
135
141
|
</View>
|
|
136
142
|
</Pressable>
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
|
|
11
12
|
interface Props {
|
|
12
13
|
children: ReactNode;
|
|
@@ -63,15 +64,19 @@ interface ErrorBoundaryFallbackProps {
|
|
|
63
64
|
|
|
64
65
|
const ErrorBoundaryFallback: React.FC<ErrorBoundaryFallbackProps> = ({
|
|
65
66
|
error,
|
|
66
|
-
fallbackTitle
|
|
67
|
-
fallbackMessage
|
|
67
|
+
fallbackTitle,
|
|
68
|
+
fallbackMessage
|
|
68
69
|
}) => {
|
|
69
70
|
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"));
|
|
70
76
|
|
|
71
|
-
const title = __DEV__ && error?.message ? "error_boundary.dev_title" : fallbackTitle;
|
|
72
77
|
const message = __DEV__ && error?.message
|
|
73
|
-
?
|
|
74
|
-
: fallbackMessage;
|
|
78
|
+
? `${t("error_boundary.dev_message")}: ${error.message}`
|
|
79
|
+
: (fallbackMessage || t("error_boundary.message"));
|
|
75
80
|
|
|
76
81
|
return (
|
|
77
82
|
<View style={[styles.container, { backgroundColor: tokens.colors.backgroundPrimary }]}>
|