chore: add new page semi&gros

This commit is contained in:
2026-03-04 19:40:51 +01:00
parent a18b71319e
commit 1320167539
2 changed files with 64 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

+64 -2
View File
@@ -13,6 +13,8 @@ import {
StyleSheet, StyleSheet,
RefreshControl, RefreshControl,
Dimensions, Dimensions,
ImageBackground,
Animated,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack"; import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
@@ -25,6 +27,9 @@ import { spacing, fontSize } from "../../theme";
import { useTheme } from "../../context/ThemeContext"; import { useTheme } from "../../context/ThemeContext";
import type { ClientStackParamList } from "../../navigation/types"; import type { ClientStackParamList } from "../../navigation/types";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const logoGrosSemi = require("../../../assets/logo-gros-semi.png");
const { width: SCREEN_WIDTH } = Dimensions.get("window"); const { width: SCREEN_WIDTH } = Dimensions.get("window");
const CARD_WIDTH = SCREEN_WIDTH - 48; const CARD_WIDTH = SCREEN_WIDTH - 48;
@@ -53,6 +58,26 @@ export default function ProductsScreen() {
const [refreshing, setRefreshing] = useState(false); const [refreshing, setRefreshing] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
const carouselRef = useRef<FlatList>(null); const carouselRef = useRef<FlatList>(null);
const scaleAnim = useRef(new Animated.Value(1)).current;
useEffect(() => {
const pulse = Animated.loop(
Animated.sequence([
Animated.timing(scaleAnim, {
toValue: 1.35,
duration: 2000,
useNativeDriver: true,
}),
Animated.timing(scaleAnim, {
toValue: 1,
duration: 2000,
useNativeDriver: true,
}),
]),
);
pulse.start();
return () => pulse.stop();
}, [scaleAnim]);
const fetchProducts = useCallback(async () => { const fetchProducts = useCallback(async () => {
setError(null); setError(null);
@@ -130,6 +155,27 @@ export default function ProductsScreen() {
fontSize: fontSize.md, fontSize: fontSize.md,
textAlign: "center", textAlign: "center",
}, },
bgImage: {
opacity: 0.12,
resizeMode: "contain",
},
comingSoonWrapper: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: "center",
alignItems: "center",
pointerEvents: "none",
},
comingSoonText: {
fontSize: 32,
fontWeight: "800",
color: colors.textWhite,
letterSpacing: 2,
textAlign: "center",
},
}), }),
[colors], [colors],
); );
@@ -139,7 +185,11 @@ export default function ProductsScreen() {
} }
return ( return (
<View style={styles.container}> <ImageBackground
source={selectedCategory === "gros&semi" ? logoGrosSemi : undefined}
style={styles.container}
imageStyle={styles.bgImage}
>
<View style={styles.filtersWrapper}> <View style={styles.filtersWrapper}>
<ScrollView <ScrollView
horizontal horizontal
@@ -204,6 +254,18 @@ export default function ProductsScreen() {
)} )}
/> />
)} )}
</View> {selectedCategory === "gros&semi" && (
<View style={styles.comingSoonWrapper}>
<Animated.Text
style={[
styles.comingSoonText,
{ transform: [{ scale: scaleAnim }] },
]}
>
Prochainement
</Animated.Text>
</View>
)}
</ImageBackground>
); );
} }