@umituz/react-native-settings 5.3.73 → 5.3.74
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": "5.3.
|
|
3
|
+
"version": "5.3.74",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification - expo-store-review and expo-device now lazy loaded",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, { useMemo, useCallback } from "react";
|
|
9
|
-
import { View,
|
|
9
|
+
import { View, FlatList } from "react-native";
|
|
10
10
|
import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
|
|
11
11
|
import { NavigationHeader, useAppNavigation } from "@umituz/react-native-design-system/molecules";
|
|
12
12
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
@@ -153,10 +153,31 @@ export const AppearanceScreen: React.FC<AppearanceScreenProps> = ({
|
|
|
153
153
|
texts?.previewSectionDescription,
|
|
154
154
|
]);
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
// Prepare data for FlatList
|
|
157
|
+
const sectionsData = useMemo(() => {
|
|
158
|
+
const items: Array<{ id: string; component: React.ReactNode }> = [];
|
|
159
|
+
|
|
160
|
+
if (headerComponentMemo) {
|
|
161
|
+
items.push({ id: 'header', component: headerComponentMemo });
|
|
162
|
+
}
|
|
163
|
+
if (themeSectionMemo) {
|
|
164
|
+
items.push({ id: 'theme', component: themeSectionMemo });
|
|
165
|
+
}
|
|
166
|
+
if (colorsSectionMemo) {
|
|
167
|
+
items.push({ id: 'colors', component: colorsSectionMemo });
|
|
168
|
+
}
|
|
169
|
+
if (previewSectionMemo) {
|
|
170
|
+
items.push({ id: 'preview', component: previewSectionMemo });
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return items;
|
|
174
|
+
}, [headerComponentMemo, themeSectionMemo, colorsSectionMemo, previewSectionMemo]);
|
|
175
|
+
|
|
176
|
+
const renderItem = useCallback(({ item }: { item: { id: string; component: React.ReactNode } }) => {
|
|
177
|
+
return <View style={{ paddingHorizontal: tokens.spacing.lg }}>{item.component}</View>;
|
|
178
|
+
}, [tokens.spacing.lg]);
|
|
179
|
+
|
|
180
|
+
const keyExtractor = useCallback((item: { id: string; component: React.ReactNode }) => item.id, []);
|
|
160
181
|
|
|
161
182
|
return (
|
|
162
183
|
<ScreenLayout
|
|
@@ -168,15 +189,15 @@ export const AppearanceScreen: React.FC<AppearanceScreenProps> = ({
|
|
|
168
189
|
/>
|
|
169
190
|
}
|
|
170
191
|
>
|
|
171
|
-
<
|
|
192
|
+
<FlatList
|
|
193
|
+
data={sectionsData}
|
|
194
|
+
renderItem={renderItem}
|
|
195
|
+
keyExtractor={keyExtractor}
|
|
172
196
|
showsVerticalScrollIndicator={false}
|
|
173
|
-
contentContainerStyle={
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
{colorsSectionMemo}
|
|
178
|
-
{previewSectionMemo}
|
|
179
|
-
</ScrollView>
|
|
197
|
+
contentContainerStyle={{
|
|
198
|
+
paddingBottom: tokens.spacing['2xl'],
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
180
201
|
</ScreenLayout>
|
|
181
202
|
);
|
|
182
203
|
};
|