alert after paroles
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
getStageAction,
|
||||
} from "../../utils/projectStages";
|
||||
|
||||
const Home = () => {
|
||||
const Home = ({ navigation, route }) => {
|
||||
const {
|
||||
userProjects = [],
|
||||
resetSelectedProject,
|
||||
@@ -216,6 +216,16 @@ const Home = () => {
|
||||
];
|
||||
}, [handleDeleteProject, menuProject?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (route?.params?.showLyricsCongrats) {
|
||||
Alert(
|
||||
"Nathalie",
|
||||
"Bravo ! Vous venez de terminer de créer les paroles de votre musique ! Maintenant vous pouvez passer à la prochaine étape : le Studio avec Malik. Dans cette étape vous allez pouvoir donner vie à votre chanson !"
|
||||
);
|
||||
navigation?.setParams?.({ showLyricsCongrats: false });
|
||||
}
|
||||
}, [navigation, route?.params?.showLyricsCongrats]);
|
||||
|
||||
const activeStage =
|
||||
stageStates[activeStageIndex] || stageStates[preferredStageIndex];
|
||||
const stageAction = useMemo(() => {
|
||||
|
||||
@@ -198,9 +198,7 @@ const CreateLyricsWithAi = () => {
|
||||
style: resolvedStyle,
|
||||
audience: audience?.trim() ? audience.trim() : undefined,
|
||||
structure:
|
||||
(customStructure &&
|
||||
parsedStructure &&
|
||||
customStructure.length === parsedStructure.length
|
||||
(Array.isArray(customStructure) && customStructure.length > 0
|
||||
? customStructure
|
||||
: parsedStructure) || undefined,
|
||||
rhymes: rhymes || undefined,
|
||||
@@ -279,11 +277,11 @@ const CreateLyricsWithAi = () => {
|
||||
// sauter Rhymes et CreatingLyrics et aller directement sur Lyrics
|
||||
if (hasLyrics && selectedIndex === 6) {
|
||||
const chosenStructure =
|
||||
(customStructure &&
|
||||
parsedStructure &&
|
||||
customStructure.length === parsedStructure.length
|
||||
Array.isArray(customStructure) && customStructure.length > 0
|
||||
? customStructure
|
||||
: parsedStructure) || [];
|
||||
: Array.isArray(parsedStructure)
|
||||
? parsedStructure
|
||||
: [];
|
||||
await updateProjectData({
|
||||
config: { structure: chosenStructure },
|
||||
selections: {
|
||||
|
||||
@@ -203,9 +203,7 @@ const CreateLyricsWithAi = () => {
|
||||
style: resolvedStyle,
|
||||
audience: audience?.trim() ? audience.trim() : undefined,
|
||||
structure:
|
||||
(customStructure &&
|
||||
parsedStructure &&
|
||||
customStructure.length === parsedStructure.length
|
||||
(Array.isArray(customStructure) && customStructure.length > 0
|
||||
? customStructure
|
||||
: parsedStructure) || undefined,
|
||||
rhymes: rhymes || undefined,
|
||||
@@ -284,11 +282,11 @@ const CreateLyricsWithAi = () => {
|
||||
// sauter Rhymes et CreatingLyrics et aller directement sur Lyrics
|
||||
if (hasLyrics && selectedIndex === 6) {
|
||||
const chosenStructure =
|
||||
(customStructure &&
|
||||
parsedStructure &&
|
||||
customStructure.length === parsedStructure.length
|
||||
Array.isArray(customStructure) && customStructure.length > 0
|
||||
? customStructure
|
||||
: parsedStructure) || [];
|
||||
: Array.isArray(parsedStructure)
|
||||
? parsedStructure
|
||||
: [];
|
||||
await updateProjectData({
|
||||
config: { structure: chosenStructure },
|
||||
selections: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { View, StyleSheet, Image, Platform, Text } from "react-native";
|
||||
import React, { useMemo, useState, useCallback, useEffect } from "react";
|
||||
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
||||
import { BlurView } from "expo-blur";
|
||||
import CreateLyricsHeader from "./components/CreateLyricsHeader";
|
||||
import { Palette, Style } from "../../styles";
|
||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import { Image, Platform, StyleSheet, Text, View } from "react-native";
|
||||
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
||||
import Sortable from "react-native-sortables";
|
||||
import { icons } from "../../assets";
|
||||
import { Palette, Style } from "../../styles";
|
||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||
import CreateLyricsHeader from "./components/CreateLyricsHeader";
|
||||
|
||||
// baseStructure: array like ['couplet','refrain',...]
|
||||
// onChange: callback that receives array like ['couplet','refrain',...]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { View, Image, StyleSheet } from "react-native";
|
||||
import React from "react";
|
||||
import Page from "../../layouts/Page";
|
||||
import { Image, StyleSheet, View } from "react-native";
|
||||
import { ai } from "../../assets";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { gutters } from "../../styles";
|
||||
import BorderGradientButton from "../../components/BorderGradientButton";
|
||||
import GradientButton from "../../components/GradientButton";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import Page from "../../layouts/Page";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { gutters } from "../../styles";
|
||||
|
||||
const FinishedWriting = () => {
|
||||
return (
|
||||
|
||||
@@ -237,7 +237,13 @@ const Lyrics = ({ navigation }) => {
|
||||
.doc(selectedProjectId)
|
||||
.set(updateData, { merge: true });
|
||||
}
|
||||
navigate(Routes.Home);
|
||||
navigate(Routes.BottomTab, {
|
||||
screen: Routes.HomeStack,
|
||||
params: {
|
||||
screen: Routes.Home,
|
||||
params: { showLyricsCongrats: true },
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
alertMessage("Erreur", "Échec de l'enregistrement dans le projet.");
|
||||
|
||||
Reference in New Issue
Block a user