feat: go back to home

This commit is contained in:
2025-12-03 17:18:37 +01:00
parent cc7782ae4e
commit 48fd1d8816
2 changed files with 74 additions and 17 deletions
+14 -4
View File
@@ -29,6 +29,7 @@ export default function LandingPage() {
const [videoUrl, setVideoUrl] = useState(null);
const [selectedLanguage, setSelectedLanguage] = useState(null);
const [showFreeCreditsPopup, setShowFreeCreditsPopup] = useState(false);
const isAuthenticated = !!currentUID;
const handleSelectLanguage = useCallback((language) => {
setSelectedLanguage(language);
@@ -38,8 +39,15 @@ export default function LandingPage() {
}, []);
const handleLaunchAdventure = useCallback(() => {
if (isAuthenticated) {
navigation.navigate(Routes.BottomTab, {
screen: Routes.HomeStack,
params: { screen: Routes.Home },
});
return;
}
navigation.navigate(Routes.Register);
}, [navigation]);
}, [isAuthenticated, navigation]);
const { data: video } = useDataFromRef({
ref: videosRef.doc("fr"),
@@ -155,9 +163,11 @@ export default function LandingPage() {
/>
<GradientButton
title={
Platform.OS === "web"
? "Je me lance dans l'aventure"
: "Commencer"
isAuthenticated
? "Continuer l'aventure"
: Platform.OS === "web"
? "Je me lance dans l'aventure"
: "Commencer"
}
onPress={handleLaunchAdventure}
containerStyle={styles.actionButton}