diff --git a/pro/app/index.tsx b/pro/app/index.tsx index a5eaa24..883784f 100644 --- a/pro/app/index.tsx +++ b/pro/app/index.tsx @@ -59,6 +59,7 @@ function Counter() { const store = useStore(); const [summary, setSummary] = useState(null); const [refreshing, setRefreshing] = useState(false); + const [tab, setTab] = useState<'scan' | 'config'>('scan'); const load = useCallback(async () => { try { @@ -113,49 +114,102 @@ function Counter() { - router.push('/scan')} - style={({ pressed }) => ({ - backgroundColor: pressed ? c.primaryPressed : c.primary, - borderRadius: 24, - paddingVertical: 48, - alignItems: 'center', - gap: 14, - })} - > - - - - Scanner une carte - QR code du Wallet du client - - - - {isManager ? "Aujourd'hui au magasin" : "Mes opérations aujourd'hui"} - - {[ - [summary?.operations ?? '—', 'opérations'], - [summary?.pointsGiven ?? '—', `${u} donnés`], - [summary?.rewards ?? '—', 'récompenses'], - ].map(([n, l]) => ( - - {n} - {l} - + {isManager && ( + + {( + [ + ['scan', 'Scan'], + ['config', 'Configuration'], + ] as const + ).map(([k, label]) => ( + setTab(k)} + style={{ flex: 1, paddingVertical: 10, borderRadius: 10, alignItems: 'center', backgroundColor: tab === k ? c.primary : 'transparent' }} + > + {label} + ))} - + )} - - {isManager &&