@umituz/react-native-ai-creations 1.3.2 → 1.3.3
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
|
@@ -59,30 +59,27 @@ export function CreationsGalleryScreen({
|
|
|
59
59
|
}, [refetch])
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
-
// Translate types for Grid display
|
|
62
|
+
// Translate types for Grid display & Filter
|
|
63
63
|
const translatedTypes = useMemo(() => {
|
|
64
64
|
return config.types.map(type => ({
|
|
65
65
|
...type,
|
|
66
|
-
labelKey: t(type.labelKey)
|
|
66
|
+
labelKey: t(type.labelKey)
|
|
67
67
|
}));
|
|
68
68
|
}, [config.types, t]);
|
|
69
69
|
|
|
70
|
-
const
|
|
71
|
-
const
|
|
70
|
+
const allCategories = useMemo(() => {
|
|
71
|
+
const categories: FilterCategory[] = [];
|
|
72
72
|
if (config.types.length > 0) {
|
|
73
|
-
|
|
73
|
+
categories.push({
|
|
74
74
|
id: 'type',
|
|
75
75
|
title: t(config.translations.filterTitle),
|
|
76
76
|
multiSelect: false,
|
|
77
77
|
options: config.types.map(type => ({ id: type.id, label: t(type.labelKey), icon: type.icon || 'image' }))
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// For now, allCategories is just the 'categories' derived from config.types
|
|
84
|
-
// In the future, other filter categories could be added here.
|
|
85
|
-
const allCategories = useMemo(() => categories, [categories]);
|
|
80
|
+
if (config.filterCategories) categories.push(...config.filterCategories);
|
|
81
|
+
return categories;
|
|
82
|
+
}, [config.types, config.filterCategories, t, config.translations.filterTitle]);
|
|
86
83
|
|
|
87
84
|
const handleShare = useCallback(async (creation: Creation) => {
|
|
88
85
|
share(creation.uri, { dialogTitle: t("common.share") });
|
|
@@ -105,8 +102,6 @@ export function CreationsGalleryScreen({
|
|
|
105
102
|
});
|
|
106
103
|
}, [alert, config, deleteMutation, t]);
|
|
107
104
|
|
|
108
|
-
const styles = useStyles(tokens);
|
|
109
|
-
|
|
110
105
|
if (selectedCreation) {
|
|
111
106
|
return (
|
|
112
107
|
<CreationDetailScreen
|
|
@@ -119,6 +114,8 @@ export function CreationsGalleryScreen({
|
|
|
119
114
|
);
|
|
120
115
|
}
|
|
121
116
|
|
|
117
|
+
const styles = useStyles(tokens);
|
|
118
|
+
|
|
122
119
|
if (!isLoading && (!creations || creations.length === 0)) {
|
|
123
120
|
return (
|
|
124
121
|
<View style={styles.container}>
|
|
@@ -178,17 +175,6 @@ export function CreationsGalleryScreen({
|
|
|
178
175
|
);
|
|
179
176
|
}
|
|
180
177
|
|
|
181
|
-
}
|
|
182
|
-
/>
|
|
183
|
-
< FilterBottomSheet
|
|
184
|
-
ref = { filterSheetRef }
|
|
185
|
-
categories = { allCategories }
|
|
186
|
-
selectedIds = { selectedIds }
|
|
187
|
-
onFilterPress = {(id, catId) => toggleFilter(id, allCategories.find(c => c.id === catId)?.multiSelect)}
|
|
188
|
-
onClearFilters = { clearFilters }
|
|
189
|
-
title = { t(config.translations.filterTitle) || t("common.filter")}
|
|
190
|
-
/>
|
|
191
|
-
</View >
|
|
192
178
|
);
|
|
193
179
|
}
|
|
194
180
|
|