- Code personnel par carte, lien d'inscription ?parrain=CODE (page de la carte, dos Apple, liens Google) - Bandeau « X vous invite » à l'inscription ; bouton Partager (partage natif ou copie) - Récompense au premier passage du filleul : parrain et filleul (réglables), une fois, au plus 10 récompenses par parrain sur 30 jours - Notifications via la rubrique Actualité (message personnel) - Admin : carte Parrainage ; app Pro : écran dans Fidélisation - Migration manuelle 2026-10-07-parrainage.sql Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73 lines
2.7 KiB
TypeScript
73 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="referral" options={{ title: 'Parrainage' }} />
|
|
<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>
|
|
);
|
|
}
|