online videos
This commit is contained in:
@@ -50,6 +50,7 @@ export const projectsRef = firestore.collection("projects");
|
|||||||
export const tasksRef = firestore.collection("tasks");
|
export const tasksRef = firestore.collection("tasks");
|
||||||
export const playlistsRef = firestore.collection("playlists");
|
export const playlistsRef = firestore.collection("playlists");
|
||||||
export const chatsRef = firestore.collection("chats");
|
export const chatsRef = firestore.collection("chats");
|
||||||
|
export const videosRef = firestore.collection("videos");
|
||||||
export const notificationsRef = firestore.collection("notifications");
|
export const notificationsRef = firestore.collection("notifications");
|
||||||
|
|
||||||
export const { arrayUnion, arrayRemove, increment, serverTimestamp } =
|
export const { arrayUnion, arrayRemove, increment, serverTimestamp } =
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { Platform, StyleSheet, View } from "react-native";
|
import { Platform, StyleSheet, View } from "react-native";
|
||||||
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
|
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
|
||||||
import { background } from "../../assets";
|
import { background, videos } from "../../assets";
|
||||||
import Alert from "../../components/Alert";
|
import Alert from "../../components/Alert";
|
||||||
import BorderGradientButton from "../../components/BorderGradientButton";
|
import BorderGradientButton from "../../components/BorderGradientButton";
|
||||||
import FeatureCarousel from "../../components/FeatureCarousel/FeatureCarousel";
|
import FeatureCarousel from "../../components/FeatureCarousel/FeatureCarousel";
|
||||||
@@ -16,7 +16,8 @@ import GradientButton from "../../components/GradientButton";
|
|||||||
import MoreMenu from "../../components/MoreMenu";
|
import MoreMenu from "../../components/MoreMenu";
|
||||||
import ProjectDropDown from "../../components/ProjectDropDown/ProjectDropDown";
|
import ProjectDropDown from "../../components/ProjectDropDown/ProjectDropDown";
|
||||||
import ShareBtn from "../../components/ShareBtn/ShareBtn";
|
import ShareBtn from "../../components/ShareBtn/ShareBtn";
|
||||||
import { projectsRef, usersRef } from "../../config/firebase";
|
import { projectsRef, usersRef, videosRef } from "../../config/firebase";
|
||||||
|
import useDataFromRef from "../../hooks/useDataFromRef";
|
||||||
import { isWeb } from "../../hooks/useLayoutType.js";
|
import { isWeb } from "../../hooks/useLayoutType.js";
|
||||||
import Page from "../../layouts/Page";
|
import Page from "../../layouts/Page";
|
||||||
import { navigate } from "../../navigation/NavigationService";
|
import { navigate } from "../../navigation/NavigationService";
|
||||||
@@ -325,6 +326,11 @@ const Home = () => {
|
|||||||
const adventureStarted =
|
const adventureStarted =
|
||||||
hasLocalAdventureFlag || !!currentUserData?.adventureStarted;
|
hasLocalAdventureFlag || !!currentUserData?.adventureStarted;
|
||||||
|
|
||||||
|
const { data: video } = useDataFromRef({
|
||||||
|
ref: videosRef.doc("fr"),
|
||||||
|
simpleRef: true,
|
||||||
|
});
|
||||||
|
const videoUrl = isWeb ? video?.landingWeb : video?.landing;
|
||||||
return adventureStarted ? (
|
return adventureStarted ? (
|
||||||
<Page
|
<Page
|
||||||
shareBtn
|
shareBtn
|
||||||
@@ -427,12 +433,14 @@ const Home = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<GradientButton
|
<GradientButton
|
||||||
|
url={videos.landing}
|
||||||
title="Commencer l'aventure MusicLand"
|
title="Commencer l'aventure MusicLand"
|
||||||
onPress={handleStartVisit}
|
onPress={handleStartVisit}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</Page>
|
</Page>
|
||||||
<FullscreenIntroVideo
|
<FullscreenIntroVideo
|
||||||
|
url={videoUrl}
|
||||||
visible={isIntroVideoVisible}
|
visible={isIntroVideoVisible}
|
||||||
onClose={handleIntroVideoClose}
|
onClose={handleIntroVideoClose}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
|
import { useNavigation } from "@react-navigation/native";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { useNavigation } from "@react-navigation/native";
|
|
||||||
import { background } from "../assets";
|
import { background } from "../assets";
|
||||||
import { usersRef } from "../config/firebase";
|
|
||||||
import FullscreenIntroVideo from "../components/FullscreenIntroVideo";
|
import FullscreenIntroVideo from "../components/FullscreenIntroVideo";
|
||||||
import GradientButton from "../components/GradientButton";
|
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 Page from "../layouts/Page";
|
||||||
import { Routes } from "../navigation/Routes";
|
import { Routes } from "../navigation/Routes";
|
||||||
import { useUser } from "../providers/UserDataProvider";
|
import { useUser } from "../providers/UserDataProvider";
|
||||||
@@ -22,10 +24,9 @@ export default function LandingPage() {
|
|||||||
if (!currentUID) {
|
if (!currentUID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await usersRef.doc(currentUID).set(
|
await usersRef
|
||||||
{ adventureStarted: true },
|
.doc(currentUID)
|
||||||
{ merge: true }
|
.set({ adventureStarted: true }, { merge: true });
|
||||||
);
|
|
||||||
}, [currentUID]);
|
}, [currentUID]);
|
||||||
|
|
||||||
const handleVideoClose = useCallback(() => {
|
const handleVideoClose = useCallback(() => {
|
||||||
@@ -38,6 +39,10 @@ export default function LandingPage() {
|
|||||||
navigation.navigate(Routes.Login);
|
navigation.navigate(Routes.Login);
|
||||||
});
|
});
|
||||||
}, [navigation, persistAdventureStarted]);
|
}, [navigation, persistAdventureStarted]);
|
||||||
|
const { data: video } = useDataFromRef({
|
||||||
|
ref: videosRef.doc("fr"),
|
||||||
|
simpleRef: true,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -61,6 +66,7 @@ export default function LandingPage() {
|
|||||||
</View>
|
</View>
|
||||||
</Page>
|
</Page>
|
||||||
<FullscreenIntroVideo
|
<FullscreenIntroVideo
|
||||||
|
url={isWeb ? video?.landingWeb : video?.landing}
|
||||||
visible={isVideoVisible}
|
visible={isVideoVisible}
|
||||||
onClose={handleVideoClose}
|
onClose={handleVideoClose}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user