alert after paroles
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useAudioPlayer, useAudioPlayerStatus } from "expo-audio";
|
||||
import React, {
|
||||
createContext,
|
||||
useCallback,
|
||||
@@ -7,7 +8,6 @@ import React, {
|
||||
useState,
|
||||
} from "react";
|
||||
import { Platform } from "react-native";
|
||||
import { useAudioPlayer, useAudioPlayerStatus } from "expo-audio";
|
||||
import { useGlobal } from "reactn";
|
||||
|
||||
import GlobalAudioPlayer from "../components/player/GlobalAudioPlayer";
|
||||
@@ -153,7 +153,12 @@ const normalizeTrack = (trackInput = {}, options = {}) => {
|
||||
if (!id && typeof source === "number") {
|
||||
id = String(source);
|
||||
}
|
||||
if (!id && source && typeof source === "object" && typeof source.uri === "string") {
|
||||
if (
|
||||
!id &&
|
||||
source &&
|
||||
typeof source === "object" &&
|
||||
typeof source.uri === "string"
|
||||
) {
|
||||
id = source.uri;
|
||||
}
|
||||
if (!id) {
|
||||
@@ -174,7 +179,12 @@ const normalizeTrack = (trackInput = {}, options = {}) => {
|
||||
? options.artist
|
||||
: "";
|
||||
|
||||
const artwork = track?.artwork ?? track?.coverUrl ?? options?.artwork ?? options?.coverUrl ?? null;
|
||||
const artwork =
|
||||
track?.artwork ??
|
||||
track?.coverUrl ??
|
||||
options?.artwork ??
|
||||
options?.coverUrl ??
|
||||
null;
|
||||
|
||||
return {
|
||||
id,
|
||||
@@ -282,7 +292,9 @@ const PlayerProvider = ({ children }) => {
|
||||
async (trackInput, options = {}) => {
|
||||
const normalized = normalizeTrack(trackInput, options);
|
||||
if (!normalized.source) {
|
||||
console.warn("PlayerProvider: impossible de lancer la lecture, source audio manquante");
|
||||
console.warn(
|
||||
"PlayerProvider: impossible de lancer la lecture, source audio manquante"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -370,7 +382,10 @@ const PlayerProvider = ({ children }) => {
|
||||
options
|
||||
);
|
||||
|
||||
if (trackInput && (!currentTrack || (targetId && targetId !== currentTrack.id))) {
|
||||
if (
|
||||
trackInput &&
|
||||
(!currentTrack || (targetId && targetId !== currentTrack.id))
|
||||
) {
|
||||
await play(trackInput, options);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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