@umituz/react-native-ai-creations 1.3.12 → 1.4.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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useCallback, useState } from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
2
|
+
import { View, StyleSheet, ActivityIndicator } from "react-native";
|
|
3
3
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
4
4
|
import { useSharing } from "@umituz/react-native-sharing";
|
|
5
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -58,27 +58,9 @@ export function CreationsGalleryScreen({
|
|
|
58
58
|
}, [refetch])
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
//
|
|
62
|
-
const translatedTypes = useMemo(() =>
|
|
63
|
-
|
|
64
|
-
...type,
|
|
65
|
-
labelKey: t(type.labelKey)
|
|
66
|
-
}));
|
|
67
|
-
}, [config.types, t]);
|
|
68
|
-
|
|
69
|
-
const allCategories = useMemo(() => {
|
|
70
|
-
const categories: FilterCategory[] = [];
|
|
71
|
-
if (config.types.length > 0) {
|
|
72
|
-
categories.push({
|
|
73
|
-
id: 'type',
|
|
74
|
-
title: t(config.translations.filterTitle),
|
|
75
|
-
multiSelect: false,
|
|
76
|
-
options: config.types.map(type => ({ id: type.id, label: t(type.labelKey), icon: type.icon || 'image' }))
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (config.filterCategories) categories.push(...config.filterCategories);
|
|
80
|
-
return categories;
|
|
81
|
-
}, [config.types, config.filterCategories, t, config.translations.filterTitle]);
|
|
61
|
+
// Prepare data for UI using utils
|
|
62
|
+
const translatedTypes = useMemo(() => getTranslatedTypes(config, t), [config, t]);
|
|
63
|
+
const allCategories = useMemo(() => getFilterCategoriesFromConfig(config, t), [config, t]);
|
|
82
64
|
|
|
83
65
|
const handleShare = useCallback(async (creation: Creation) => {
|
|
84
66
|
share(creation.uri, { dialogTitle: t("common.share") });
|
|
@@ -148,18 +130,15 @@ export function CreationsGalleryScreen({
|
|
|
148
130
|
onDelete={handleDelete}
|
|
149
131
|
contentContainerStyle={{ paddingBottom: insets.bottom + tokens.spacing.xl }}
|
|
150
132
|
/>
|
|
151
|
-
<
|
|
152
|
-
|
|
133
|
+
<CreationImageViewer
|
|
134
|
+
creations={filtered}
|
|
153
135
|
visible={viewerVisible}
|
|
154
136
|
index={viewerIndex}
|
|
155
137
|
onDismiss={() => setViewerVisible(false)}
|
|
156
138
|
onIndexChange={setViewerIndex}
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
|
|
160
|
-
if (selectedCreation) { await onImageEdit(uri, (selectedCreation as Creation).id); refetch(); }
|
|
161
|
-
}
|
|
162
|
-
} as any)}
|
|
139
|
+
enableEditing={enableEditing}
|
|
140
|
+
onImageEdit={onImageEdit}
|
|
141
|
+
selectedCreationId={selectedCreation?.id}
|
|
163
142
|
/>
|
|
164
143
|
<FilterBottomSheet
|
|
165
144
|
ref={filterSheetRef}
|
|
@@ -177,6 +156,11 @@ export function CreationsGalleryScreen({
|
|
|
177
156
|
|
|
178
157
|
|
|
179
158
|
|
|
159
|
+
import { View, StyleSheet, ActivityIndicator } from "react-native";
|
|
160
|
+
|
|
161
|
+
// ... (logic remains same, just adding styles below)
|
|
162
|
+
|
|
180
163
|
const useStyles = (tokens: any) => StyleSheet.create({
|
|
181
164
|
container: { flex: 1, backgroundColor: tokens.colors.background },
|
|
165
|
+
center: { justifyContent: 'center', alignItems: 'center' },
|
|
182
166
|
});
|