chore: add comming soon category
This commit is contained in:
@@ -117,6 +117,7 @@ export interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
color: string;
|
||||
is_coming_soon: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,6 +164,13 @@ export default function ProductsScreen() {
|
||||
paddingBottom: 96,
|
||||
pointerEvents: "none",
|
||||
},
|
||||
comingSoonContent: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
padding: spacing.xl,
|
||||
gap: spacing.m,
|
||||
},
|
||||
comingSoonText: {
|
||||
fontSize: 36,
|
||||
color: "#8E8FE8",
|
||||
@@ -174,10 +181,18 @@ export default function ProductsScreen() {
|
||||
textShadowOffset: { width: 0, height: 0 },
|
||||
textShadowRadius: 18,
|
||||
},
|
||||
comingSoonDesc: {
|
||||
fontSize: fontSize.md,
|
||||
color: "rgba(142, 143, 232, 0.7)",
|
||||
textAlign: "center",
|
||||
},
|
||||
}),
|
||||
[colors],
|
||||
);
|
||||
|
||||
const selectedCategoryObj = categories.find((c) => c.name === selectedCategory);
|
||||
const isSelectedComingSoon = selectedCategoryObj?.is_coming_soon ?? false;
|
||||
|
||||
if (loading && !refreshing) {
|
||||
return <LoadingSpinner message="Chargement des produits..." />;
|
||||
}
|
||||
@@ -215,7 +230,18 @@ export default function ProductsScreen() {
|
||||
{selectedCategory === "tous" ? "Tous les produits" : selectedCategory}
|
||||
</Text>
|
||||
</View>
|
||||
{error ? (
|
||||
{isSelectedComingSoon ? (
|
||||
<View style={styles.comingSoonContent}>
|
||||
<Animated.Text
|
||||
style={[styles.comingSoonText, { transform: [{ scale: scaleAnim }] }]}
|
||||
>
|
||||
Prochainement
|
||||
</Animated.Text>
|
||||
<Text style={styles.comingSoonDesc}>
|
||||
Les produits de cette catégorie arrivent bientôt !
|
||||
</Text>
|
||||
</View>
|
||||
) : error ? (
|
||||
<View style={styles.center}>
|
||||
<Text style={styles.errorText}>{error}</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user