chore: fix unit

This commit is contained in:
2026-03-04 17:03:08 +01:00
parent 06cfbae4e1
commit a18b71319e
3 changed files with 6 additions and 4 deletions
+1
View File
@@ -366,6 +366,7 @@ export interface Product {
description?: string; description?: string;
category: string; category: string;
stock: number; stock: number;
unit?: string;
prices?: ProductPrice[]; prices?: ProductPrice[];
media?: Array<{ media?: Array<{
// ✅ CHANGÉ // ✅ CHANGÉ
+2 -1
View File
@@ -27,6 +27,7 @@ interface ProductCardProps {
name: string; name: string;
category: string; category: string;
stock: number; stock: number;
unit?: string;
prices?: Array<{ quantity: number; price: number }>; prices?: Array<{ quantity: number; price: number }>;
media?: Array<{ url: string; type: string }>; media?: Array<{ url: string; type: string }>;
}; };
@@ -289,7 +290,7 @@ export default function ProductCard({ product, onPress }: ProductCardProps) {
{ color: colors.textWhite }, { color: colors.textWhite },
]} ]}
> >
{p.quantity}g {p.quantity}{product.unit || "g"}
</Text> </Text>
<Text <Text
style={[ style={[
@@ -529,7 +529,7 @@ export default function ProductDetailScreen() {
<View style={styles.priceIndicator} /> <View style={styles.priceIndicator} />
<Text style={styles.priceText}> <Text style={styles.priceText}>
{selectedPrice.toFixed(2)} {" "} {selectedPrice.toFixed(2)} {" "}
{selectedGrams && `pour ${selectedGrams}g`} {selectedGrams && `pour ${selectedGrams}${product.unit || "g"}`}
</Text> </Text>
</View> </View>
)} )}
@@ -557,7 +557,7 @@ export default function ProductDetailScreen() {
> >
<Text style={styles.dropdownText}> <Text style={styles.dropdownText}>
{selectedGrams !== null {selectedGrams !== null
? `${selectedGrams}g - ${selectedPrice.toFixed(2)}` ? `${selectedGrams}${product.unit || "g"} - ${selectedPrice.toFixed(2)}`
: "Choisir une quantite"} : "Choisir une quantite"}
</Text> </Text>
<Ionicons <Ionicons
@@ -645,7 +645,7 @@ export default function ProductDetailScreen() {
}, },
]} ]}
> >
{p.quantity}g {p.quantity}{product.unit || "g"}
</Text> </Text>
<Text <Text
style={[ style={[