online videos

This commit is contained in:
2025-10-13 13:26:54 +02:00
parent 7fdbb2344e
commit 4c90ce7b6e
3 changed files with 23 additions and 8 deletions
+12 -6
View File
@@ -1,10 +1,12 @@
import { useNavigation } from "@react-navigation/native";
import { useCallback, useState } from "react";
import { View } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { background } from "../assets";
import { usersRef } from "../config/firebase";
import FullscreenIntroVideo from "../components/FullscreenIntroVideo";
import GradientButton from "../components/GradientButton";
import { usersRef, videosRef } from "../config/firebase";
import useDataFromRef from "../hooks/useDataFromRef";
import { isWeb } from "../hooks/useLayoutType";
import Page from "../layouts/Page";
import { Routes } from "../navigation/Routes";
import { useUser } from "../providers/UserDataProvider";
@@ -22,10 +24,9 @@ export default function LandingPage() {
if (!currentUID) {
return;
}
await usersRef.doc(currentUID).set(
{ adventureStarted: true },
{ merge: true }
);
await usersRef
.doc(currentUID)
.set({ adventureStarted: true }, { merge: true });
}, [currentUID]);
const handleVideoClose = useCallback(() => {
@@ -38,6 +39,10 @@ export default function LandingPage() {
navigation.navigate(Routes.Login);
});
}, [navigation, persistAdventureStarted]);
const { data: video } = useDataFromRef({
ref: videosRef.doc("fr"),
simpleRef: true,
});
return (
<>
@@ -61,6 +66,7 @@ export default function LandingPage() {
</View>
</Page>
<FullscreenIntroVideo
url={isWeb ? video?.landingWeb : video?.landing}
visible={isVideoVisible}
onClose={handleVideoClose}
/>