end of tickets

This commit is contained in:
Thomas Demirdjian
2025-11-17 15:54:54 +01:00
parent c7cbd85088
commit 016f7c27ac
8 changed files with 159 additions and 71 deletions
+16 -4
View File
@@ -37,6 +37,12 @@ const Lyrics = ({ navigation }) => {
const [containerLayout, setContainerLayout] = useState(null);
const { setIsLoading } = useMinuit();
const { selectedProjectId, selectedProject } = useUser();
const hasExistingMusicDraft = useMemo(() => {
if (!Array.isArray(selectedProject?.musicUrls)) return false;
return selectedProject.musicUrls.some(
(url) => typeof url === "string" && url.trim()
);
}, [selectedProject?.musicUrls]);
const [isFocus, setIsFocus] = useState(null);
const [itemsContainerLayout, setItemsContainerLayout] = useState([]);
const [sensitiveContentModal, setSensitiveContentModal] = useState({
@@ -306,6 +312,14 @@ const Lyrics = ({ navigation }) => {
}
const beatmakerStage = getStageAction("beatmaker", projectForStage);
await setIsLoading(false);
if (hasExistingMusicDraft) {
navigate(Routes.ComposeSong, { isRegeneration: true });
return;
}
const handleNavigateToStudio = () => {
const targetRoute = beatmakerStage?.route || Routes.Compose;
navigate(targetRoute, beatmakerStage?.params);
};
alert(
"Céline",
"Bravo ! Vous venez de terminer de créer les paroles de votre musique ! Maintenant vous pouvez passer à la prochaine étape : le Studio pour donner vie à votre chanson !",
@@ -323,10 +337,7 @@ const Lyrics = ({ navigation }) => {
},
{
text: "Continuer vers le Studio",
onPress: () => {
const targetRoute = beatmakerStage?.route || Routes.Compose;
navigate(targetRoute, beatmakerStage?.params);
},
onPress: handleNavigateToStudio,
},
]
);
@@ -350,6 +361,7 @@ const Lyrics = ({ navigation }) => {
projectHasLyrics,
projectLyrics,
selectedProject,
hasExistingMusicDraft,
]);
const typeOccurrences = {};