@umituz/react-native-ai-generation-content 1.12.12 → 1.12.14
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
|
@@ -52,6 +52,7 @@ export interface CreationsConfig {
|
|
|
52
52
|
readonly gridColumns?: number;
|
|
53
53
|
readonly pathBuilder?: PathBuilder;
|
|
54
54
|
readonly documentMapper?: DocumentMapper;
|
|
55
|
+
readonly enableFiltering?: boolean;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export const DEFAULT_TRANSLATIONS: CreationsTranslations = {
|
|
@@ -13,6 +13,9 @@ interface GalleryHeaderProps {
|
|
|
13
13
|
readonly onFavoritesPress?: () => void;
|
|
14
14
|
readonly showOnlyFavorites?: boolean;
|
|
15
15
|
readonly style?: any;
|
|
16
|
+
readonly subtitle?: string;
|
|
17
|
+
readonly isFilterEnabled?: boolean;
|
|
18
|
+
readonly showCount?: boolean;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
@@ -25,6 +28,9 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
25
28
|
filterIcon = 'filter-outline',
|
|
26
29
|
onFavoritesPress,
|
|
27
30
|
showOnlyFavorites = false,
|
|
31
|
+
subtitle,
|
|
32
|
+
isFilterEnabled = true,
|
|
33
|
+
showCount = true,
|
|
28
34
|
style,
|
|
29
35
|
}) => {
|
|
30
36
|
const tokens = useAppDesignTokens();
|
|
@@ -35,7 +41,7 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
35
41
|
<View style={styles.titleArea}>
|
|
36
42
|
{!!title && <AtomicText style={styles.title}>{title}</AtomicText>}
|
|
37
43
|
<AtomicText style={styles.subtitle}>
|
|
38
|
-
{count} {countLabel}
|
|
44
|
+
{subtitle || (showCount ? `${count} ${countLabel}` : '')}
|
|
39
45
|
</AtomicText>
|
|
40
46
|
</View>
|
|
41
47
|
<View style={styles.actions}>
|
|
@@ -52,23 +58,25 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
52
58
|
/>
|
|
53
59
|
</TouchableOpacity>
|
|
54
60
|
)}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
{isFilterEnabled && (
|
|
62
|
+
<TouchableOpacity
|
|
63
|
+
onPress={onFilterPress}
|
|
64
|
+
style={[styles.filterButton, isFiltered && styles.filterButtonActive]}
|
|
65
|
+
activeOpacity={0.7}
|
|
66
|
+
>
|
|
67
|
+
<AtomicIcon
|
|
68
|
+
name={filterIcon}
|
|
69
|
+
size="sm"
|
|
70
|
+
color={isFiltered ? "primary" : "secondary"}
|
|
71
|
+
/>
|
|
72
|
+
<AtomicText style={[styles.filterText, { color: isFiltered ? tokens.colors.primary : tokens.colors.textSecondary }]}>
|
|
73
|
+
{filterLabel}
|
|
74
|
+
</AtomicText>
|
|
75
|
+
{isFiltered && (
|
|
76
|
+
<View style={styles.badge} />
|
|
77
|
+
)}
|
|
78
|
+
</TouchableOpacity>
|
|
79
|
+
)}
|
|
72
80
|
</View>
|
|
73
81
|
</View>
|
|
74
82
|
);
|
|
@@ -32,13 +32,14 @@ interface CreationsGalleryScreenProps {
|
|
|
32
32
|
readonly userId: string | null;
|
|
33
33
|
readonly repository: ICreationsRepository;
|
|
34
34
|
readonly config: CreationsConfig;
|
|
35
|
-
readonly t: (key: string) => string;
|
|
35
|
+
readonly t: (key: string, options?: any) => string;
|
|
36
36
|
readonly enableEditing?: boolean;
|
|
37
37
|
readonly onImageEdit?: (uri: string, creationId: string) => void | Promise<void>;
|
|
38
38
|
readonly onEmptyAction?: () => void;
|
|
39
39
|
readonly emptyActionLabel?: string;
|
|
40
40
|
readonly onBackPress?: () => void;
|
|
41
41
|
readonly headerTitle?: string;
|
|
42
|
+
readonly showCount?: boolean;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
export function CreationsGalleryScreen({
|
|
@@ -52,6 +53,7 @@ export function CreationsGalleryScreen({
|
|
|
52
53
|
emptyActionLabel,
|
|
53
54
|
onBackPress,
|
|
54
55
|
headerTitle,
|
|
56
|
+
showCount = true,
|
|
55
57
|
}: CreationsGalleryScreenProps) {
|
|
56
58
|
const tokens = useAppDesignTokens();
|
|
57
59
|
const { share } = useSharing();
|
|
@@ -201,12 +203,15 @@ export function CreationsGalleryScreen({
|
|
|
201
203
|
<GalleryHeader
|
|
202
204
|
title={showScreenHeader || isSelectionMode ? '' : screenTitle}
|
|
203
205
|
count={filtered.length}
|
|
204
|
-
countLabel=
|
|
206
|
+
countLabel=''
|
|
207
|
+
subtitle={showCount ? t(config.translations.photoCount, { count: filtered.length }) : undefined}
|
|
205
208
|
isFiltered={isFiltered}
|
|
206
209
|
filterLabel={t(config.translations.filterLabel) || 'Filter'}
|
|
207
210
|
onFilterPress={() => filterSheetRef.current?.present()}
|
|
208
211
|
onFavoritesPress={() => setShowOnlyFavorites(!showOnlyFavorites)}
|
|
209
212
|
showOnlyFavorites={showOnlyFavorites}
|
|
213
|
+
isFilterEnabled={config.enableFiltering ?? false}
|
|
214
|
+
showCount={showCount}
|
|
210
215
|
/>
|
|
211
216
|
)}
|
|
212
217
|
|