chore: finish features comming soon

This commit is contained in:
2026-05-19 20:11:54 +02:00
parent 929dea7249
commit 8df5bd66d3
4 changed files with 160 additions and 67 deletions
@@ -70,7 +70,9 @@ export default function ProductDetailScreen() {
setSelectedPrice(fixedProduct.prices[0].price);
}
const matched = categories.find(
(c) => c.name.toLowerCase() === (p.category || "").toLowerCase(),
(c) =>
c.name.toLowerCase() ===
(p.category || "").toLowerCase(),
);
if (matched?.color) setCatColor(matched.color);
} else {
@@ -111,11 +113,19 @@ export default function ProductDetailScreen() {
const catTextColor = (() => {
const h = catColor.replace("#", "");
const full = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
const full =
h.length === 3
? h
.split("")
.map((c) => c + c)
.join("")
: h;
const r = parseInt(full.slice(0, 2), 16);
const g = parseInt(full.slice(2, 4), 16);
const b = parseInt(full.slice(4, 6), 16);
return (r * 299 + g * 587 + b * 114) / 1000 > 128 ? "#000000" : "#ffffff";
return (r * 299 + g * 587 + b * 114) / 1000 > 128
? "#000000"
: "#ffffff";
})();
const overlayBg = isDark ? "rgba(255,255,255,0.02)" : "rgba(0,0,0,0.02)";
@@ -546,7 +556,9 @@ export default function ProductDetailScreen() {
)}
{isComingSoon && (
<View style={styles.comingSoonBadge}>
<Text style={styles.comingSoonText}>À VENIR</Text>
<Text style={styles.comingSoonText}>
COMMING SOON
</Text>
</View>
)}
{videoUri && !isOutOfStock && (
@@ -573,7 +585,8 @@ export default function ProductDetailScreen() {
<View style={styles.priceIndicator} />
<Text style={styles.priceText}>
{selectedPrice.toFixed(2)} {" "}
{selectedGrams && `pour ${selectedGrams}${product.unit || "g"}`}
{selectedGrams &&
`pour ${selectedGrams}${product.unit || "g"}`}
</Text>
</View>
)}
@@ -615,27 +628,34 @@ export default function ProductDetailScreen() {
<TouchableOpacity
style={[
styles.addToCartBtn,
(isOutOfStock || isComingSoon || selectedGrams === null) &&
(isOutOfStock ||
isComingSoon ||
selectedGrams === null) &&
styles.addToCartBtnDisabled,
]}
onPress={handleAddToCart}
disabled={
isOutOfStock || isComingSoon || selectedGrams === null || adding
isOutOfStock ||
isComingSoon ||
selectedGrams === null ||
adding
}
activeOpacity={0.7}
>
<Text
style={[
styles.addToCartText,
(isOutOfStock || isComingSoon || selectedGrams === null) &&
(isOutOfStock ||
isComingSoon ||
selectedGrams === null) &&
styles.addToCartTextDisabled,
]}
>
{isOutOfStock
? "Rupture de stock"
: isComingSoon
? "Bientôt disponible"
: "Ajouter au panier"}
? "Bientôt disponible"
: "Ajouter au panier"}
</Text>
</TouchableOpacity>
</View>
@@ -691,7 +711,8 @@ export default function ProductDetailScreen() {
},
]}
>
{p.quantity}{product.unit || "g"}
{p.quantity}
{product.unit || "g"}
</Text>
<Text
style={[