online videos
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user