clear last tickets
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { Image, StyleSheet, View } from "react-native";
|
||||
import { ai, background } from "../../assets";
|
||||
import BorderGradientButton from "../../components/BorderGradientButton";
|
||||
@@ -8,40 +8,23 @@ import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import Page from "../../layouts/Page";
|
||||
import { isWeb } from "../../hooks/useLayoutType";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { navigate } from "../../navigation/NavigationService";
|
||||
import { useUser } from "../../providers/UserDataProvider";
|
||||
import { gutters } from "../../styles";
|
||||
|
||||
const Playback = ({ route, navigation }) => {
|
||||
const { project } = route.params || {};
|
||||
const { videos } = useUser();
|
||||
const [showIntro, setShowIntro] = useState(false);
|
||||
const benhaiUrl = isWeb ? videos?.benhaiWeb || null : videos?.benhai;
|
||||
const [showIntro, setShowIntro] = useState(benhaiUrl);
|
||||
|
||||
const introVideoUrl = useMemo(() => {
|
||||
if (!videos) {
|
||||
return null;
|
||||
const handleCloseIntro = () => {
|
||||
if (showIntro === benhaiUrl) {
|
||||
setShowIntro(videos.theo);
|
||||
} else {
|
||||
setShowIntro(null);
|
||||
}
|
||||
return isWeb ? videos?.benhaiWeb || null : videos?.benhai || null;
|
||||
}, [videos]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!introVideoUrl) {
|
||||
setShowIntro(false);
|
||||
return;
|
||||
}
|
||||
setShowIntro(true);
|
||||
}, [introVideoUrl]);
|
||||
|
||||
const handleCloseIntro = useCallback(() => {
|
||||
setShowIntro(false);
|
||||
}, []);
|
||||
|
||||
const handleShowGuide = useCallback(() => {
|
||||
if (!introVideoUrl) {
|
||||
return;
|
||||
}
|
||||
setShowIntro(true);
|
||||
}, [introVideoUrl]);
|
||||
};
|
||||
|
||||
const onPressRecord = useCallback(() => {
|
||||
navigate(Routes.RecordPlayback, { project });
|
||||
@@ -68,14 +51,14 @@ const Playback = ({ route, navigation }) => {
|
||||
/>
|
||||
<BorderGradientButton
|
||||
title="Guide du Playbacker"
|
||||
onPress={handleShowGuide}
|
||||
onPress={() => setShowIntro(videos.theo)}
|
||||
/>
|
||||
{/* <BorderGradientButton title="Importer une vidéo" /> */}
|
||||
</View>
|
||||
</View>
|
||||
<FullscreenIntroVideo
|
||||
url={introVideoUrl}
|
||||
visible={showIntro && !!introVideoUrl}
|
||||
url={showIntro}
|
||||
visible={showIntro}
|
||||
onClose={handleCloseIntro}
|
||||
/>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user