@umituz/react-native-ai-generation-content 1.12.16 → 1.12.18

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-ai-generation-content",
3
- "version": "1.12.16",
3
+ "version": "1.12.18",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -78,4 +78,4 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  }
81
- }
81
+ }
@@ -9,7 +9,6 @@ import {
9
9
  AlertMode,
10
10
  type BottomSheetModalRef
11
11
  } from "@umituz/react-native-design-system";
12
- import { useFocusEffect } from "@react-navigation/native";
13
12
  import { useCreations } from "../hooks/useCreations";
14
13
  import { useDeleteCreation } from "../hooks/useDeleteCreation";
15
14
  import { useCreationsFilter } from "../hooks/useCreationsFilter";
@@ -41,6 +40,7 @@ interface CreationsGalleryScreenProps {
41
40
  readonly headerTitle?: string;
42
41
  readonly showCount?: boolean;
43
42
  readonly enableSearch?: boolean;
43
+ readonly enableFilter?: boolean;
44
44
  readonly showGalleryHeader?: boolean;
45
45
  }
46
46
 
@@ -57,6 +57,7 @@ export function CreationsGalleryScreen({
57
57
  headerTitle,
58
58
  showCount = true,
59
59
  enableSearch = true,
60
+ enableFilter = false,
60
61
  showGalleryHeader = true,
61
62
  }: CreationsGalleryScreenProps) {
62
63
  const tokens = useAppDesignTokens();
@@ -90,15 +91,6 @@ export function CreationsGalleryScreen({
90
91
  const [selectedItemIds, setSelectedItemIds] = useState<string[]>([]);
91
92
  const [isSelectionMode, setIsSelectionMode] = useState(false);
92
93
 
93
-
94
-
95
- // Refetch creations when screen comes into focus
96
- useFocusEffect(
97
- useCallback(() => {
98
- refetch();
99
- }, [refetch])
100
- );
101
-
102
94
  // Prepare data for UI using utils
103
95
  const translatedTypes = useMemo(() => getTranslatedTypes(config, t), [config, t]);
104
96
  const allCategories = useMemo(() => getFilterCategoriesFromConfig(config, t), [config, t]);
@@ -203,22 +195,20 @@ export function CreationsGalleryScreen({
203
195
  }
204
196
  contentContainerStyle={{ paddingHorizontal: 0 }}
205
197
  >
206
- {(!creations || creations?.length === 0) && !isLoading ? null : (
207
- showGalleryHeader ? (
208
- <GalleryHeader
209
- title={showScreenHeader || isSelectionMode ? '' : screenTitle}
210
- count={filtered.length}
211
- countLabel=''
212
- subtitle={showCount ? t(config.translations.photoCount, { count: filtered.length }) : undefined}
213
- isFiltered={isFiltered}
214
- filterLabel={t(config.translations.filterLabel) || 'Filter'}
215
- onFilterPress={() => filterSheetRef.current?.present()}
216
- onFavoritesPress={() => setShowOnlyFavorites(!showOnlyFavorites)}
217
- showOnlyFavorites={showOnlyFavorites}
218
- isFilterEnabled={config.enableFiltering ?? false}
219
- showCount={showCount}
220
- />
221
- ) : null
198
+ {creations && creations.length > 0 && showGalleryHeader && (
199
+ <GalleryHeader
200
+ title={showScreenHeader || isSelectionMode ? '' : screenTitle}
201
+ count={filtered.length}
202
+ countLabel=''
203
+ subtitle={showCount ? t(config.translations.photoCount, { count: filtered.length }) : undefined}
204
+ isFiltered={isFiltered}
205
+ filterLabel={t(config.translations.filterLabel) || 'Filter'}
206
+ onFilterPress={() => filterSheetRef.current?.present()}
207
+ onFavoritesPress={() => setShowOnlyFavorites(!showOnlyFavorites)}
208
+ showOnlyFavorites={showOnlyFavorites}
209
+ isFilterEnabled={enableFilter}
210
+ showCount={showCount}
211
+ />
222
212
  )}
223
213
 
224
214
  {/* Main Content Grid - handles empty/loading via ListEmptyComponent */}