feat(frontend): add product detail view and navigation
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled

- Create ProductView component with product details display
- Add ProductView.css with responsive styling
- Add product screen to App.jsx screen system
- Pass onNavigateToProduct callback from App to SearchView
- Update ProductResults onSelect to use callback instead of window.location
This commit is contained in:
Antoni Nuñez Romeu
2026-07-13 17:36:52 +02:00
parent 31c1a14343
commit 731a6c98ae
4 changed files with 246 additions and 2 deletions
+12
View File
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import './App.css';
import HomeView from './views/HomeView';
import SearchView from './views/SearchView';
import ProductView from './views/ProductView';
import ScannerView from './views/ScannerView';
import AlertsView from './views/AlertsView';
import ProfileView from './views/ProfileView';
@@ -19,6 +20,7 @@ function App() {
const [showSaved, setShowSaved] = useState(false);
const [badgeCount, setBadgeCount] = useState(0);
const [prescriptionSearch, setPrescriptionSearch] = useState('');
const [productScreen, setProductScreen] = useState(null);
const [screenSize, setScreenSize] = useState({
width: window.innerWidth,
height: window.innerHeight
@@ -180,6 +182,16 @@ function App() {
currentUser={currentUser}
onLoginRequest={() => setShowLogin(true)}
initialQuery={prescriptionSearch}
onNavigateToProduct={(source, id) => setProductScreen({ source, id })}
/>
);
break;
case 'product':
activeView = (
<ProductView
source={productScreen?.source}
id={productScreen?.id}
onBack={() => { setProductScreen(null); setScreen('search'); }}
/>
);
break;