From b1ab6a549ffc237426d1754400a050dd6f400aee Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 10 Dec 2025 15:16:30 +0100 Subject: [PATCH] feat: videos --- src/screens/Playback/Playback.js | 11 ++++------- src/screens/cover/ValidateCover.js | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/screens/Playback/Playback.js b/src/screens/Playback/Playback.js index b39ff46..ad0a080 100644 --- a/src/screens/Playback/Playback.js +++ b/src/screens/Playback/Playback.js @@ -15,15 +15,12 @@ import { gutters } from "../../styles"; const Playback = ({ route, navigation }) => { const { project } = route.params || {}; const { videos } = useUser(); - const benhaiUrl = isWeb ? videos?.benhaiWeb || null : videos?.benhai; - const [showIntro, setShowIntro] = useState(benhaiUrl); + // const benhaiUrl = isWeb ? videos?.benhaiWeb || null : videos?.benhai; + const theoUrl = isWeb ? videos?.theoWeb : videos?.theo; + const [showIntro, setShowIntro] = useState(theoUrl); const handleCloseIntro = () => { - if (showIntro === benhaiUrl) { - setShowIntro(isWeb ? videos?.theoWeb : videos?.theo); - } else { - setShowIntro(null); - } + setShowIntro(null); }; const onPressRecord = useCallback(() => { diff --git a/src/screens/cover/ValidateCover.js b/src/screens/cover/ValidateCover.js index bf48888..465cfd6 100644 --- a/src/screens/cover/ValidateCover.js +++ b/src/screens/cover/ValidateCover.js @@ -1,3 +1,4 @@ +import FullscreenIntroVideo from "../../components/FullscreenIntroVideo"; import { Image as ExpoImage } from "expo-image"; import React, { useCallback, useMemo, useState } from "react"; import { Pressable, Text, View } from "react-native"; @@ -9,12 +10,16 @@ import { isWeb } from "../../hooks/useLayoutType"; import Page from "../../layouts/Page"; import { Routes } from "../../navigation"; import { goBack, navigate } from "../../navigation/NavigationService"; -import { useUserData } from "../../providers/UserDataProvider"; +import { useUser, useUserData } from "../../providers/UserDataProvider"; import { gutters, Palette, Style } from "../../styles"; import CreateLyricsHeader from "../Writing/components/CreateLyricsHeader"; const ValidateCover = () => { const { selectedProject, updateProjectData } = useUserData(); + const { videos } = useUser(); + const benhaiUrl = isWeb ? videos?.benhaiWeb || null : videos?.benhai; + const [showIntro, setShowIntro] = useState(null); + const { setIsLoading } = useMinuit(); const coverOptions = useMemo(() => { @@ -95,12 +100,17 @@ const ValidateCover = () => { if (!selectedOption) { return; } + setShowIntro(benhaiUrl); + } + + const handleCloseIntro = useCallback(() => { + setShowIntro(null); navigate(Routes.SongDownload, { project: selectedProject, selectedOption, coverOptions, }); - } + }, [selectedProject, selectedOption, coverOptions]); return ( @@ -240,6 +250,11 @@ const ValidateCover = () => { disabled={!selectedOption || isSelecting} /> + ); };