fix: product detail view for parapharmacy products

- Updated ProductView to use correct endpoint for parapharmacy
- Updated getProduct service to handle parapharmacy products
- Shows price, category, brand, source for parapharmacy products
- Updated labels from 'OFF' to 'Parafarmacia'
This commit is contained in:
Antoni Nuñez Romeu
2026-07-16 15:47:14 +02:00
parent 570d4ab43e
commit 3429b7e548
3 changed files with 39 additions and 25 deletions
@@ -62,7 +62,7 @@ export default function ProductDetailScreen() {
<View style={styles.nameRow}>
<Text style={[styles.name, { color: colors.text }]}>{product.name}</Text>
<View style={[styles.badge, { backgroundColor: isCima ? '#2b5bb5' : '#4caf50' }]}>
<Text style={styles.badgeText}>{isCima ? 'CIMA' : 'OFF'}</Text>
<Text style={styles.badgeText}>{isCima ? 'CIMA' : 'Parafarmacia'}</Text>
</View>
</View>
{product.brand ? (
@@ -92,21 +92,21 @@ export default function ProductDetailScreen() {
</View>
) : (
<View style={[styles.infoSection, { backgroundColor: colors.card }]}>
<Text style={[styles.sectionTitle, { color: colors.text }]}>Información nutricional</Text>
{product.nutriscore && (
<InfoRow label="Nutri-Score" value={product.nutriscore.toUpperCase()} colors={colors} />
<Text style={[styles.sectionTitle, { color: colors.text }]}>Información del producto</Text>
{product.price != null && (
<InfoRow label="Precio" value={`${product.price} €`} colors={colors} />
)}
{product.nova_group != null && (
<InfoRow label="Grupo NOVA" value={String(product.nova_group)} colors={colors} />
{product.original_price != null && product.original_price > (product.price || 0) && (
<InfoRow label="Precio anterior" value={`${product.original_price} €`} colors={colors} />
)}
{product.eco_score && (
<InfoRow label="Eco-Score" value={product.eco_score.toUpperCase()} colors={colors} />
{product.category && (
<InfoRow label="Categoría" value={product.category} colors={colors} />
)}
{product.ingredients && (
<View style={[styles.infoRow, { borderBottomColor: colors.border }]}>
<Text style={[styles.infoLabel, { color: colors.textSecondary }]}>Ingredientes</Text>
<Text style={[styles.infoValueMultiline, { color: colors.text }]}>{product.ingredients}</Text>
</View>
{product.brand && (
<InfoRow label="Marca" value={product.brand} colors={colors} />
)}
{product.source_url && (
<InfoRow label="Fuente" value={product.source || 'Parafarmacia'} colors={colors} />
)}
</View>
)}