web modals
This commit is contained in:
@@ -11,6 +11,7 @@ import ValidateModal from "../../components/modal/ValidateModal";
|
|||||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||||
import Slider from "../../components/Slider";
|
import Slider from "../../components/Slider";
|
||||||
import firebase from "../../config/firebase";
|
import firebase from "../../config/firebase";
|
||||||
|
import alert from "../../components/Alert";
|
||||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||||
import Page from "../../layouts/Page";
|
import Page from "../../layouts/Page";
|
||||||
import { Routes } from "../../navigation";
|
import { Routes } from "../../navigation";
|
||||||
@@ -18,6 +19,7 @@ import { navigate } from "../../navigation/NavigationService";
|
|||||||
import { useUser } from "../../providers/UserDataProvider";
|
import { useUser } from "../../providers/UserDataProvider";
|
||||||
import { Style } from "../../styles";
|
import { Style } from "../../styles";
|
||||||
import { gutters, size } from "../../styles/Style";
|
import { gutters, size } from "../../styles/Style";
|
||||||
|
import { isWeb } from "../../hooks/useLayoutType";
|
||||||
import CreateLyricsHeader from "../Writing/components/CreateLyricsHeader";
|
import CreateLyricsHeader from "../Writing/components/CreateLyricsHeader";
|
||||||
|
|
||||||
const SongReady = () => {
|
const SongReady = () => {
|
||||||
@@ -193,6 +195,31 @@ const SongReady = () => {
|
|||||||
};
|
};
|
||||||
}, [player0, player1]);
|
}, [player0, player1]);
|
||||||
|
|
||||||
|
const handleChooseTrack = () => {
|
||||||
|
if (isWeb) {
|
||||||
|
alert(
|
||||||
|
"Attention !",
|
||||||
|
"Lorsque tu clique sur valider, tu ne pourra plus changer ni le texte ni la mélodie.",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: "Retour",
|
||||||
|
style: "cancel",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Valider",
|
||||||
|
style: "confirm",
|
||||||
|
onPress: () => {
|
||||||
|
validateSelection();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setShowValidateModal(true);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerType="NONE" backgroundImg={background.studioBG2} maxWidth={800}>
|
<Page headerType="NONE" backgroundImg={background.studioBG2} maxWidth={800}>
|
||||||
<MusicLandHeader
|
<MusicLandHeader
|
||||||
@@ -337,15 +364,17 @@ const SongReady = () => {
|
|||||||
/>
|
/>
|
||||||
<GradientButton
|
<GradientButton
|
||||||
title="Choisir ce morceau"
|
title="Choisir ce morceau"
|
||||||
onPress={() => setShowValidateModal(true)}
|
onPress={handleChooseTrack}
|
||||||
disabled={!musicUrls?.length}
|
disabled={!musicUrls?.length}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<ValidateModal
|
{!isWeb && (
|
||||||
visible={showValidateModal}
|
<ValidateModal
|
||||||
onClose={() => setShowValidateModal(false)}
|
visible={showValidateModal}
|
||||||
onPressValidate={validateSelection}
|
onClose={() => setShowValidateModal(false)}
|
||||||
/>
|
onPressValidate={validateSelection}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user