- Lien de la fiche Google validé (https, domaines Google), demande après 1/2/3/5 passages - Notification unique 2 h après le passage (10 h–20 h), lien au dos de la carte Apple, dans les liens Google Wallet et sur la page de la carte ; clics comptés via redirection - Admin : carte Avis Google ; app Pro : écran Fidélisation regroupant les 4 outils - Correctif : l'heure de Paris (« 23 h ») était lue comme NaN, la relance des inactifs pouvait partir la nuit - Migration manuelle 2026-10-07-avis-google.sql Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
2.7 KiB
TypeScript
72 lines
2.7 KiB
TypeScript
import { useEffect } from 'react';
|
|
import { Stack } from 'expo-router';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import * as SplashScreen from 'expo-splash-screen';
|
|
import {
|
|
useFonts,
|
|
Figtree_400Regular,
|
|
Figtree_500Medium,
|
|
Figtree_600SemiBold,
|
|
Figtree_700Bold,
|
|
Figtree_800ExtraBold,
|
|
} from '@expo-google-fonts/figtree';
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
import { SessionProvider, useSession } from '../src/session';
|
|
import { font, useColors } from '../src/theme';
|
|
|
|
SplashScreen.preventAutoHideAsync();
|
|
|
|
function Navigator() {
|
|
const { status } = useSession();
|
|
const c = useColors();
|
|
|
|
useEffect(() => {
|
|
if (status !== 'loading') SplashScreen.hideAsync();
|
|
}, [status]);
|
|
|
|
if (status === 'loading') return null;
|
|
const signedIn = status === 'signed-in';
|
|
return (
|
|
<Stack
|
|
screenOptions={{
|
|
headerStyle: { backgroundColor: c.bg },
|
|
headerShadowVisible: false,
|
|
headerTintColor: c.text,
|
|
headerTitleStyle: { fontFamily: font.bold },
|
|
headerBackButtonDisplayMode: 'minimal',
|
|
contentStyle: { backgroundColor: c.bg },
|
|
}}
|
|
>
|
|
<Stack.Protected guard={!signedIn}>
|
|
<Stack.Screen name="login" options={{ headerShown: false }} />
|
|
</Stack.Protected>
|
|
<Stack.Protected guard={signedIn}>
|
|
<Stack.Screen name="index" options={{ headerShown: false }} />
|
|
<Stack.Screen name="scan" options={{ headerShown: false, presentation: 'fullScreenModal' }} />
|
|
<Stack.Screen name="client/[serial]/index" options={{ title: 'Client' }} />
|
|
<Stack.Screen name="client/[serial]/credit" options={{ title: 'Créditer' }} />
|
|
<Stack.Screen name="client/[serial]/rewards" options={{ title: 'Récompenses' }} />
|
|
<Stack.Screen name="done" options={{ headerShown: false, gestureEnabled: false }} />
|
|
<Stack.Screen name="history" options={{ title: 'Historique' }} />
|
|
<Stack.Screen name="campaigns" options={{ title: 'Campagnes' }} />
|
|
<Stack.Screen name="reminders" options={{ title: 'Relance des inactifs' }} />
|
|
<Stack.Screen name="birthday" options={{ title: "Offre d'anniversaire" }} />
|
|
<Stack.Screen name="reviews" options={{ title: 'Avis Google' }} />
|
|
<Stack.Screen name="loyalty" options={{ title: 'Fidélisation' }} />
|
|
</Stack.Protected>
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
export default function RootLayout() {
|
|
const [loaded] = useFonts({ Figtree_400Regular, Figtree_500Medium, Figtree_600SemiBold, Figtree_700Bold, Figtree_800ExtraBold });
|
|
if (!loaded) return null;
|
|
return (
|
|
<SafeAreaProvider>
|
|
<SessionProvider>
|
|
<StatusBar style="auto" />
|
|
<Navigator />
|
|
</SessionProvider>
|
|
</SafeAreaProvider>
|
|
);
|
|
}
|