@umituz/react-native-ai-generation-content 1.17.0 → 1.17.1
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 +13 -14
- package/src/domains/creations/domain/entities/Creation.ts +33 -2
- package/src/domains/creations/domain/entities/index.ts +1 -1
- package/src/domains/creations/domain/types/creation-categories.ts +133 -0
- package/src/domains/creations/domain/types/creation-filter.ts +131 -0
- package/src/domains/creations/domain/types/creation-types.ts +63 -0
- package/src/domains/creations/domain/types/index.ts +44 -0
- package/src/domains/creations/domain/utils/creation-helpers.ts +134 -0
- package/src/domains/creations/domain/utils/index.ts +8 -0
- package/src/domains/creations/domain/utils/preview-helpers.ts +84 -0
- package/src/domains/creations/domain/utils/status-helpers.ts +90 -0
- package/src/domains/creations/index.ts +95 -21
- package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +14 -1
- package/src/domains/creations/presentation/components/CreationActions.tsx +120 -0
- package/src/domains/creations/presentation/components/CreationBadges.tsx +111 -0
- package/src/domains/creations/presentation/components/CreationCard.tsx +201 -102
- package/src/domains/creations/presentation/components/CreationPreview.tsx +117 -0
- package/src/domains/creations/presentation/components/CreationsFilterBar.tsx +254 -0
- package/src/domains/creations/presentation/components/CreationsGrid.tsx +121 -68
- package/src/domains/creations/presentation/components/index.ts +23 -3
- package/src/domains/creations/presentation/hooks/index.ts +1 -0
- package/src/domains/creations/presentation/hooks/useAdvancedFilter.ts +262 -0
- package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +5 -6
- package/src/features/ai-hug/domain/index.ts +5 -0
- package/src/features/ai-hug/domain/types/ai-hug.types.ts +72 -0
- package/src/features/ai-hug/domain/types/index.ts +14 -0
- package/src/features/ai-hug/index.ts +27 -0
- package/src/features/ai-hug/infrastructure/index.ts +5 -0
- package/src/features/ai-hug/infrastructure/services/ai-hug-executor.ts +96 -0
- package/src/features/ai-hug/infrastructure/services/index.ts +6 -0
- package/src/features/ai-hug/presentation/hooks/index.ts +9 -0
- package/src/features/ai-hug/presentation/hooks/useAIHugFeature.ts +157 -0
- package/src/features/ai-hug/presentation/index.ts +5 -0
- package/src/features/ai-kiss/domain/index.ts +5 -0
- package/src/features/ai-kiss/domain/types/ai-kiss.types.ts +72 -0
- package/src/features/ai-kiss/domain/types/index.ts +14 -0
- package/src/features/ai-kiss/index.ts +27 -0
- package/src/features/ai-kiss/infrastructure/index.ts +5 -0
- package/src/features/ai-kiss/infrastructure/services/ai-kiss-executor.ts +96 -0
- package/src/features/ai-kiss/infrastructure/services/index.ts +6 -0
- package/src/features/ai-kiss/presentation/hooks/index.ts +9 -0
- package/src/features/ai-kiss/presentation/hooks/useAIKissFeature.ts +157 -0
- package/src/features/ai-kiss/presentation/index.ts +5 -0
- package/src/features/anime-selfie/domain/index.ts +5 -0
- package/src/features/anime-selfie/domain/types/anime-selfie.types.ts +72 -0
- package/src/features/anime-selfie/domain/types/index.ts +15 -0
- package/src/features/anime-selfie/index.ts +28 -0
- package/src/features/anime-selfie/infrastructure/index.ts +5 -0
- package/src/features/anime-selfie/infrastructure/services/anime-selfie-executor.ts +95 -0
- package/src/features/anime-selfie/infrastructure/services/index.ts +6 -0
- package/src/features/anime-selfie/presentation/hooks/index.ts +9 -0
- package/src/features/anime-selfie/presentation/hooks/useAnimeSelfieFeature.ts +138 -0
- package/src/features/anime-selfie/presentation/index.ts +5 -0
- package/src/features/background/domain/types/index.ts +15 -0
- package/src/features/background/domain/types/replace-background.types.ts +82 -0
- package/src/features/background/index.ts +31 -3
- package/src/features/background/infrastructure/index.ts +5 -0
- package/src/features/background/infrastructure/services/index.ts +6 -0
- package/src/features/background/infrastructure/services/replace-background-executor.ts +95 -0
- package/src/features/background/presentation/hooks/index.ts +6 -1
- package/src/features/background/presentation/hooks/useReplaceBackgroundFeature.ts +160 -0
- package/src/features/face-swap/domain/index.ts +5 -0
- package/src/features/face-swap/domain/types/face-swap.types.ts +72 -0
- package/src/features/face-swap/domain/types/index.ts +14 -0
- package/src/features/face-swap/index.ts +27 -1
- package/src/features/face-swap/infrastructure/index.ts +5 -0
- package/src/features/face-swap/infrastructure/services/face-swap-executor.ts +96 -0
- package/src/features/face-swap/infrastructure/services/index.ts +6 -0
- package/src/features/face-swap/presentation/hooks/index.ts +9 -0
- package/src/features/face-swap/presentation/hooks/useFaceSwapFeature.ts +157 -0
- package/src/features/face-swap/presentation/index.ts +5 -0
- package/src/features/photo-restoration/domain/types/index.ts +2 -5
- package/src/features/photo-restoration/domain/types/photo-restore.types.ts +14 -0
- package/src/features/photo-restoration/index.ts +3 -8
- package/src/features/photo-restoration/infrastructure/services/index.ts +1 -6
- package/src/features/photo-restoration/infrastructure/services/photo-restore-executor.ts +64 -30
- package/src/features/photo-restoration/presentation/hooks/usePhotoRestoreFeature.ts +11 -6
- package/src/features/remove-background/domain/index.ts +5 -0
- package/src/features/remove-background/domain/types/index.ts +14 -0
- package/src/features/remove-background/domain/types/remove-background.types.ts +69 -0
- package/src/features/remove-background/index.ts +27 -0
- package/src/features/remove-background/infrastructure/index.ts +5 -0
- package/src/features/remove-background/infrastructure/services/index.ts +6 -0
- package/src/features/remove-background/infrastructure/services/remove-background-executor.ts +95 -0
- package/src/features/remove-background/presentation/hooks/index.ts +9 -0
- package/src/features/remove-background/presentation/hooks/useRemoveBackgroundFeature.ts +137 -0
- package/src/features/remove-background/presentation/index.ts +5 -0
- package/src/features/remove-object/domain/index.ts +5 -0
- package/src/features/remove-object/domain/types/index.ts +14 -0
- package/src/features/remove-object/domain/types/remove-object.types.ts +77 -0
- package/src/features/remove-object/index.ts +27 -0
- package/src/features/remove-object/infrastructure/index.ts +5 -0
- package/src/features/remove-object/infrastructure/services/index.ts +6 -0
- package/src/features/remove-object/infrastructure/services/remove-object-executor.ts +99 -0
- package/src/features/remove-object/presentation/hooks/index.ts +9 -0
- package/src/features/remove-object/presentation/hooks/useRemoveObjectFeature.ts +168 -0
- package/src/features/remove-object/presentation/index.ts +5 -0
- package/src/features/upscaling/domain/types/index.ts +0 -1
- package/src/features/upscaling/domain/types/upscale.types.ts +14 -0
- package/src/features/upscaling/index.ts +3 -11
- package/src/features/upscaling/infrastructure/services/index.ts +1 -6
- package/src/features/upscaling/infrastructure/services/upscale-executor.ts +64 -30
- package/src/features/upscaling/presentation/hooks/useUpscaleFeature.ts +12 -7
- package/src/index.ts +39 -0
- package/src/types/jsx.d.ts +19 -0
- package/src/features/face-swap/domain/entities.ts +0 -48
- package/src/features/photo-restoration/domain/types/provider.types.ts +0 -23
- package/src/features/photo-restoration/infrastructure/services/photo-restore-provider-registry.ts +0 -77
- package/src/features/upscaling/domain/types/provider.types.ts +0 -23
- package/src/features/upscaling/infrastructure/services/upscale-provider-registry.ts +0 -77
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CreationsFilterBar Component
|
|
3
|
+
* Filter buttons with dropdown-style appearance
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { useMemo } from "react";
|
|
7
|
+
import { View, StyleSheet, ScrollView, TouchableOpacity } from "react-native";
|
|
8
|
+
import {
|
|
9
|
+
useAppDesignTokens,
|
|
10
|
+
AtomicText,
|
|
11
|
+
AtomicIcon,
|
|
12
|
+
} from "@umituz/react-native-design-system";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Filter button configuration
|
|
16
|
+
*/
|
|
17
|
+
export interface FilterButton {
|
|
18
|
+
/** Unique filter identifier */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Display label */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Icon name */
|
|
23
|
+
icon?: string;
|
|
24
|
+
/** Is this filter active */
|
|
25
|
+
active: boolean;
|
|
26
|
+
/** Handler when pressed */
|
|
27
|
+
onPress: () => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface CreationsFilterBarProps {
|
|
31
|
+
/** Array of filter buttons */
|
|
32
|
+
readonly filters: FilterButton[];
|
|
33
|
+
/** Show clear button when any filter is active */
|
|
34
|
+
readonly showClearButton?: boolean;
|
|
35
|
+
/** Clear button label */
|
|
36
|
+
readonly clearLabel?: string;
|
|
37
|
+
/** Clear all filters handler */
|
|
38
|
+
readonly onClear?: () => void;
|
|
39
|
+
/** Has any active filters (for showing clear button) */
|
|
40
|
+
readonly hasActiveFilters?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function CreationsFilterBar({
|
|
44
|
+
filters,
|
|
45
|
+
showClearButton = true,
|
|
46
|
+
clearLabel = "Clear",
|
|
47
|
+
onClear,
|
|
48
|
+
hasActiveFilters = false,
|
|
49
|
+
}: CreationsFilterBarProps) {
|
|
50
|
+
const tokens = useAppDesignTokens();
|
|
51
|
+
|
|
52
|
+
const styles = useMemo(
|
|
53
|
+
() =>
|
|
54
|
+
StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
marginTop: 8,
|
|
57
|
+
},
|
|
58
|
+
scrollContent: {
|
|
59
|
+
paddingHorizontal: 16,
|
|
60
|
+
gap: 8,
|
|
61
|
+
flexDirection: "row",
|
|
62
|
+
},
|
|
63
|
+
filterButton: {
|
|
64
|
+
flexDirection: "row",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
paddingHorizontal: 12,
|
|
67
|
+
paddingVertical: 8,
|
|
68
|
+
borderRadius: 20,
|
|
69
|
+
minHeight: 36,
|
|
70
|
+
gap: 6,
|
|
71
|
+
},
|
|
72
|
+
filterButtonActive: {
|
|
73
|
+
backgroundColor: tokens.colors.primary + "15",
|
|
74
|
+
borderWidth: 1,
|
|
75
|
+
borderColor: tokens.colors.primary,
|
|
76
|
+
},
|
|
77
|
+
filterButtonInactive: {
|
|
78
|
+
backgroundColor: tokens.colors.backgroundSecondary,
|
|
79
|
+
},
|
|
80
|
+
filterText: {
|
|
81
|
+
fontSize: 14,
|
|
82
|
+
},
|
|
83
|
+
clearButton: {
|
|
84
|
+
flexDirection: "row",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
paddingHorizontal: 12,
|
|
87
|
+
paddingVertical: 8,
|
|
88
|
+
borderRadius: 20,
|
|
89
|
+
borderWidth: 1,
|
|
90
|
+
borderColor: tokens.colors.primary,
|
|
91
|
+
minHeight: 36,
|
|
92
|
+
},
|
|
93
|
+
clearText: {
|
|
94
|
+
marginLeft: 4,
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
[tokens]
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<View style={styles.container}>
|
|
102
|
+
<ScrollView
|
|
103
|
+
horizontal
|
|
104
|
+
showsHorizontalScrollIndicator={false}
|
|
105
|
+
contentContainerStyle={styles.scrollContent}
|
|
106
|
+
>
|
|
107
|
+
{filters.map((filter) => (
|
|
108
|
+
<TouchableOpacity
|
|
109
|
+
key={filter.id}
|
|
110
|
+
style={[
|
|
111
|
+
styles.filterButton,
|
|
112
|
+
filter.active
|
|
113
|
+
? styles.filterButtonActive
|
|
114
|
+
: styles.filterButtonInactive,
|
|
115
|
+
]}
|
|
116
|
+
onPress={filter.onPress}
|
|
117
|
+
>
|
|
118
|
+
{filter.icon && (
|
|
119
|
+
<AtomicIcon
|
|
120
|
+
name={filter.icon}
|
|
121
|
+
size="sm"
|
|
122
|
+
color={filter.active ? "primary" : "secondary"}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
<AtomicText
|
|
126
|
+
type="bodyMedium"
|
|
127
|
+
style={[
|
|
128
|
+
styles.filterText,
|
|
129
|
+
{
|
|
130
|
+
color: filter.active
|
|
131
|
+
? tokens.colors.primary
|
|
132
|
+
: tokens.colors.textPrimary,
|
|
133
|
+
fontWeight: filter.active ? "600" : "400",
|
|
134
|
+
},
|
|
135
|
+
]}
|
|
136
|
+
>
|
|
137
|
+
{filter.label}
|
|
138
|
+
</AtomicText>
|
|
139
|
+
<AtomicIcon
|
|
140
|
+
name="chevron-down"
|
|
141
|
+
size="xs"
|
|
142
|
+
color={filter.active ? "primary" : "secondary"}
|
|
143
|
+
/>
|
|
144
|
+
</TouchableOpacity>
|
|
145
|
+
))}
|
|
146
|
+
|
|
147
|
+
{showClearButton && hasActiveFilters && onClear && (
|
|
148
|
+
<TouchableOpacity style={styles.clearButton} onPress={onClear}>
|
|
149
|
+
<AtomicIcon name="close" size="sm" color="primary" />
|
|
150
|
+
<AtomicText
|
|
151
|
+
type="bodySmall"
|
|
152
|
+
style={[styles.clearText, { color: tokens.colors.primary }]}
|
|
153
|
+
>
|
|
154
|
+
{clearLabel}
|
|
155
|
+
</AtomicText>
|
|
156
|
+
</TouchableOpacity>
|
|
157
|
+
)}
|
|
158
|
+
</ScrollView>
|
|
159
|
+
</View>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Helper to create filter buttons from filter state
|
|
165
|
+
*/
|
|
166
|
+
export function createMediaFilterButtons(
|
|
167
|
+
activeFilter: string,
|
|
168
|
+
onSelect: (filter: string) => void,
|
|
169
|
+
labels: { all: string; images: string; videos: string; voice: string }
|
|
170
|
+
): FilterButton[] {
|
|
171
|
+
return [
|
|
172
|
+
{
|
|
173
|
+
id: "all",
|
|
174
|
+
label: labels.all,
|
|
175
|
+
icon: "grid",
|
|
176
|
+
active: activeFilter === "all",
|
|
177
|
+
onPress: () => onSelect("all"),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "image",
|
|
181
|
+
label: labels.images,
|
|
182
|
+
icon: "image",
|
|
183
|
+
active: activeFilter === "image",
|
|
184
|
+
onPress: () => onSelect("image"),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: "video",
|
|
188
|
+
label: labels.videos,
|
|
189
|
+
icon: "film",
|
|
190
|
+
active: activeFilter === "video",
|
|
191
|
+
onPress: () => onSelect("video"),
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "voice",
|
|
195
|
+
label: labels.voice,
|
|
196
|
+
icon: "mic",
|
|
197
|
+
active: activeFilter === "voice",
|
|
198
|
+
onPress: () => onSelect("voice"),
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Helper to create status filter buttons
|
|
205
|
+
*/
|
|
206
|
+
export function createStatusFilterButtons(
|
|
207
|
+
activeFilter: string,
|
|
208
|
+
onSelect: (filter: string) => void,
|
|
209
|
+
labels: {
|
|
210
|
+
all: string;
|
|
211
|
+
completed: string;
|
|
212
|
+
pending: string;
|
|
213
|
+
processing: string;
|
|
214
|
+
failed: string;
|
|
215
|
+
}
|
|
216
|
+
): FilterButton[] {
|
|
217
|
+
return [
|
|
218
|
+
{
|
|
219
|
+
id: "all",
|
|
220
|
+
label: labels.all,
|
|
221
|
+
icon: "options",
|
|
222
|
+
active: activeFilter === "all",
|
|
223
|
+
onPress: () => onSelect("all"),
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "completed",
|
|
227
|
+
label: labels.completed,
|
|
228
|
+
icon: "checkmark-circle",
|
|
229
|
+
active: activeFilter === "completed",
|
|
230
|
+
onPress: () => onSelect("completed"),
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "processing",
|
|
234
|
+
label: labels.processing,
|
|
235
|
+
icon: "refresh",
|
|
236
|
+
active: activeFilter === "processing",
|
|
237
|
+
onPress: () => onSelect("processing"),
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: "pending",
|
|
241
|
+
label: labels.pending,
|
|
242
|
+
icon: "time",
|
|
243
|
+
active: activeFilter === "pending",
|
|
244
|
+
onPress: () => onSelect("pending"),
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "failed",
|
|
248
|
+
label: labels.failed,
|
|
249
|
+
icon: "close-circle",
|
|
250
|
+
active: activeFilter === "failed",
|
|
251
|
+
onPress: () => onSelect("failed"),
|
|
252
|
+
},
|
|
253
|
+
];
|
|
254
|
+
}
|
|
@@ -1,77 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CreationCard } from "./CreationCard";
|
|
1
|
+
/**
|
|
2
|
+
* CreationsGrid Component
|
|
3
|
+
* Grid/list of creation cards with refresh support
|
|
4
|
+
*/
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import React, { useCallback } from "react";
|
|
7
|
+
import {
|
|
8
|
+
FlatList,
|
|
9
|
+
RefreshControl,
|
|
10
|
+
StyleSheet,
|
|
11
|
+
type ViewStyle,
|
|
12
|
+
} from "react-native";
|
|
13
|
+
import {
|
|
14
|
+
useAppDesignTokens,
|
|
15
|
+
type DesignTokens,
|
|
16
|
+
} from "@umituz/react-native-design-system";
|
|
17
|
+
import { CreationCard, type CreationCardData } from "./CreationCard";
|
|
18
|
+
|
|
19
|
+
interface CreationsGridProps<T extends CreationCardData> {
|
|
20
|
+
/** Array of creations to display */
|
|
21
|
+
readonly creations: T[];
|
|
22
|
+
/** Loading state for refresh indicator */
|
|
23
|
+
readonly isLoading: boolean;
|
|
24
|
+
/** Pull to refresh handler */
|
|
25
|
+
readonly onRefresh: () => void;
|
|
26
|
+
/** Press handler */
|
|
27
|
+
readonly onPress?: (creation: T) => void;
|
|
28
|
+
/** Download handler */
|
|
29
|
+
readonly onDownload?: (creation: T) => Promise<void>;
|
|
30
|
+
/** Share handler */
|
|
31
|
+
readonly onShare?: (creation: T) => Promise<void>;
|
|
32
|
+
/** Delete handler */
|
|
33
|
+
readonly onDelete?: (creation: T) => void;
|
|
34
|
+
/** Favorite handler */
|
|
35
|
+
readonly onFavorite?: (creation: T) => void;
|
|
36
|
+
/** Post to feed handler */
|
|
37
|
+
readonly onPostToFeed?: (creation: T) => void;
|
|
38
|
+
/** Date formatter */
|
|
39
|
+
readonly formatDate?: (date: Date) => string;
|
|
40
|
+
/** Can post to feed */
|
|
41
|
+
readonly canPostToFeed?: boolean;
|
|
42
|
+
/** Content container style */
|
|
43
|
+
readonly contentContainerStyle?: ViewStyle;
|
|
44
|
+
/** Empty state component */
|
|
45
|
+
readonly ListEmptyComponent?: React.ReactElement | null;
|
|
46
|
+
/** Header component */
|
|
47
|
+
readonly ListHeaderComponent?:
|
|
48
|
+
| React.ComponentType<unknown>
|
|
49
|
+
| React.ReactElement
|
|
50
|
+
| null;
|
|
19
51
|
}
|
|
20
52
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
export function CreationsGrid<T extends CreationCardData>({
|
|
54
|
+
creations,
|
|
55
|
+
isLoading,
|
|
56
|
+
onRefresh,
|
|
57
|
+
onPress,
|
|
58
|
+
onDownload,
|
|
59
|
+
onShare,
|
|
60
|
+
onDelete,
|
|
61
|
+
onFavorite,
|
|
62
|
+
onPostToFeed,
|
|
63
|
+
formatDate,
|
|
64
|
+
canPostToFeed = false,
|
|
65
|
+
contentContainerStyle,
|
|
66
|
+
ListEmptyComponent,
|
|
67
|
+
ListHeaderComponent,
|
|
68
|
+
}: CreationsGridProps<T>) {
|
|
69
|
+
const tokens = useAppDesignTokens();
|
|
70
|
+
const styles = useStyles(tokens);
|
|
36
71
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
72
|
+
const renderItem = useCallback(
|
|
73
|
+
({ item }: { item: T }) => (
|
|
74
|
+
<CreationCard
|
|
75
|
+
creation={item}
|
|
76
|
+
callbacks={{
|
|
77
|
+
onPress: onPress ? () => onPress(item) : undefined,
|
|
78
|
+
onDownload: onDownload ? () => onDownload(item) : undefined,
|
|
79
|
+
onShare: onShare ? () => onShare(item) : undefined,
|
|
80
|
+
onDelete: onDelete ? () => onDelete(item) : undefined,
|
|
81
|
+
onFavorite: onFavorite ? () => onFavorite(item) : undefined,
|
|
82
|
+
onPostToFeed: onPostToFeed ? () => onPostToFeed(item) : undefined,
|
|
83
|
+
}}
|
|
84
|
+
formatDate={formatDate}
|
|
85
|
+
canPostToFeed={canPostToFeed}
|
|
86
|
+
/>
|
|
87
|
+
),
|
|
88
|
+
[
|
|
89
|
+
onPress,
|
|
90
|
+
onDownload,
|
|
91
|
+
onShare,
|
|
92
|
+
onDelete,
|
|
93
|
+
onFavorite,
|
|
94
|
+
onPostToFeed,
|
|
95
|
+
formatDate,
|
|
96
|
+
canPostToFeed,
|
|
97
|
+
]
|
|
98
|
+
);
|
|
47
99
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/>
|
|
67
|
-
}
|
|
100
|
+
return (
|
|
101
|
+
<FlatList
|
|
102
|
+
data={creations}
|
|
103
|
+
renderItem={renderItem}
|
|
104
|
+
keyExtractor={(item) => item.id}
|
|
105
|
+
ListHeaderComponent={ListHeaderComponent}
|
|
106
|
+
ListEmptyComponent={ListEmptyComponent}
|
|
107
|
+
contentContainerStyle={[
|
|
108
|
+
styles.list,
|
|
109
|
+
contentContainerStyle,
|
|
110
|
+
(!creations || creations.length === 0) && { flexGrow: 1 },
|
|
111
|
+
]}
|
|
112
|
+
showsVerticalScrollIndicator={false}
|
|
113
|
+
refreshControl={
|
|
114
|
+
<RefreshControl
|
|
115
|
+
refreshing={isLoading}
|
|
116
|
+
onRefresh={onRefresh}
|
|
117
|
+
tintColor={tokens.colors.primary}
|
|
68
118
|
/>
|
|
69
|
-
|
|
70
|
-
|
|
119
|
+
}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
71
123
|
|
|
72
|
-
const useStyles = (tokens: DesignTokens) =>
|
|
124
|
+
const useStyles = (tokens: DesignTokens) =>
|
|
125
|
+
StyleSheet.create({
|
|
73
126
|
list: {
|
|
74
|
-
|
|
75
|
-
|
|
127
|
+
padding: tokens.spacing.md,
|
|
128
|
+
paddingBottom: 100,
|
|
76
129
|
},
|
|
77
|
-
});
|
|
130
|
+
});
|
|
@@ -2,15 +2,35 @@
|
|
|
2
2
|
* Presentation Components
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
// Core Components
|
|
6
|
+
export { CreationPreview } from "./CreationPreview";
|
|
7
|
+
export { CreationBadges } from "./CreationBadges";
|
|
8
|
+
export { CreationActions, type CreationAction } from "./CreationActions";
|
|
9
|
+
export {
|
|
10
|
+
CreationCard,
|
|
11
|
+
type CreationCardData,
|
|
12
|
+
type CreationCardCallbacks,
|
|
13
|
+
} from "./CreationCard";
|
|
14
|
+
export { CreationThumbnail } from "./CreationThumbnail";
|
|
15
|
+
|
|
16
|
+
// Filter Components
|
|
17
|
+
export { FilterChips } from "./FilterChips";
|
|
18
|
+
export {
|
|
19
|
+
CreationsFilterBar,
|
|
20
|
+
createMediaFilterButtons,
|
|
21
|
+
createStatusFilterButtons,
|
|
22
|
+
type FilterButton,
|
|
23
|
+
} from "./CreationsFilterBar";
|
|
24
|
+
|
|
25
|
+
// Gallery Components
|
|
5
26
|
export { GalleryHeader } from "./GalleryHeader";
|
|
6
27
|
export { EmptyState } from "./EmptyState";
|
|
7
28
|
export { GalleryEmptyStates } from "./GalleryEmptyStates";
|
|
8
|
-
export { FilterChips } from "./FilterChips";
|
|
9
29
|
export { CreationsHomeCard } from "./CreationsHomeCard";
|
|
10
|
-
export { CreationCard } from "./CreationCard";
|
|
11
|
-
export { CreationThumbnail } from "./CreationThumbnail";
|
|
12
30
|
export { CreationImageViewer } from "./CreationImageViewer";
|
|
13
31
|
export { CreationsGrid } from "./CreationsGrid";
|
|
32
|
+
|
|
33
|
+
// Provider
|
|
14
34
|
export { CreationsProvider, useCreationsProvider } from "./CreationsProvider";
|
|
15
35
|
|
|
16
36
|
// Detail Components
|