feat: go back to home
This commit is contained in:
@@ -456,6 +456,10 @@ const Home = ({ navigation, route }) => {
|
||||
setCoinModalVisible(false);
|
||||
}, []);
|
||||
|
||||
const handleNavigateToLanding = useCallback(() => {
|
||||
navigate(Routes.LandingPage);
|
||||
}, []);
|
||||
|
||||
const stageCardContainerStyle = isWeb ? styles.cardsGrid : styles.cardsStack;
|
||||
const stageCardItemStyle = isWeb
|
||||
? styles.webStageCard
|
||||
@@ -516,6 +520,19 @@ const Home = ({ navigation, route }) => {
|
||||
|
||||
const topBar = (
|
||||
<View style={styles.topBar}>
|
||||
<Pressable
|
||||
onPress={handleNavigateToLanding}
|
||||
accessibilityRole="button"
|
||||
style={[
|
||||
styles.returnLandingButton,
|
||||
isWeb ? styles.returnLandingButtonWeb : null,
|
||||
]}
|
||||
>
|
||||
<Text style={styles.returnLandingButtonText}>
|
||||
Retour à l'accueil
|
||||
</Text>
|
||||
</Pressable>
|
||||
<View style={styles.topBarContent}>
|
||||
{mobileInfoRow}
|
||||
<ProjectDropDown
|
||||
ref={projectDropdownRef}
|
||||
@@ -529,6 +546,7 @@ const Home = ({ navigation, route }) => {
|
||||
formatDate={formatDate}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
const journeyContent = (
|
||||
@@ -710,11 +728,40 @@ const styles = StyleSheet.create({
|
||||
flexWrap: isWeb ? "wrap" : "nowrap",
|
||||
alignItems: isWeb ? "center" : "stretch",
|
||||
justifyContent: isWeb ? "center" : "flex-start",
|
||||
gap: 12,
|
||||
gap: isWeb ? 0 : 12,
|
||||
marginTop: isWeb ? 12 : 0,
|
||||
marginBottom: isWeb ? 4 : 16,
|
||||
paddingHorizontal: isWeb ? 0 : gutters,
|
||||
zIndex: 10,
|
||||
position: "relative",
|
||||
},
|
||||
returnLandingButton: {
|
||||
paddingHorizontal: 14,
|
||||
paddingVertical: 10,
|
||||
borderRadius: 18,
|
||||
backgroundColor: "rgba(12, 14, 18, 0.72)",
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(255, 255, 255, 0.1)",
|
||||
alignSelf: "flex-start",
|
||||
},
|
||||
returnLandingButtonWeb: {
|
||||
position: "absolute",
|
||||
left: 0,
|
||||
top: 0,
|
||||
transform: [{ translateY: -2 }],
|
||||
},
|
||||
returnLandingButtonText: {
|
||||
fontSize: 14,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterSemiBold,
|
||||
},
|
||||
topBarContent: {
|
||||
flex: 1,
|
||||
width: "100%",
|
||||
flexDirection: isWeb ? "row" : "column",
|
||||
alignItems: isWeb ? "center" : "stretch",
|
||||
justifyContent: isWeb ? "center" : "flex-start",
|
||||
gap: 12,
|
||||
},
|
||||
projectDropDown: {
|
||||
width: isWeb ? 420 : "100%",
|
||||
|
||||
@@ -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,7 +163,9 @@ export default function LandingPage() {
|
||||
/>
|
||||
<GradientButton
|
||||
title={
|
||||
Platform.OS === "web"
|
||||
isAuthenticated
|
||||
? "Continuer l'aventure"
|
||||
: Platform.OS === "web"
|
||||
? "Je me lance dans l'aventure"
|
||||
: "Commencer"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user