- Anniversaire facultatif (jour + mois) à l'inscription ou sur la page de la carte
- Réglages par magasin : activation, points/tampons offerts, message {prenom} {cadeau}
- Passage horaire 9 h–19 h (Paris), un cadeau par an, 29 février fêté le 28
- Notification Apple (Actualité) et Google, solde mis à jour
- Admin : onglet Fidélisation ; app Pro : écran gérant
- Politique de confidentialité mise à jour
- Migration manuelle 2026-10-07-anniversaire.sql
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
2.5 KiB
TypeScript
70 lines
2.5 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.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>
|
|
);
|
|
}
|