move cover flow
This commit is contained in:
@@ -34,12 +34,6 @@ const STAGE_CARD_CONTENT = [
|
||||
description: "Come back, when you'll have lyrics!",
|
||||
image: ai.rightIcon,
|
||||
},
|
||||
{
|
||||
key: "designer",
|
||||
title: "Bena",
|
||||
description: "Come back when you want to generate cover!",
|
||||
image: ai.leftIcon,
|
||||
},
|
||||
{
|
||||
key: "director",
|
||||
title: "John",
|
||||
|
||||
@@ -33,12 +33,6 @@ const STAGE_CARD_CONTENT = [
|
||||
description: "Come back, when you'll have lyrics!",
|
||||
image: ai.rightIcon,
|
||||
},
|
||||
{
|
||||
key: "designer",
|
||||
title: "Bena",
|
||||
description: "Come back when you want to generate cover!",
|
||||
image: ai.leftIcon,
|
||||
},
|
||||
{
|
||||
key: "director",
|
||||
title: "John",
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { BlurView } from "expo-blur";
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import {
|
||||
Animated,
|
||||
Dimensions,
|
||||
@@ -10,7 +17,6 @@ import {
|
||||
Text,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { BlurView } from "expo-blur";
|
||||
import { icons, img } from "../../assets";
|
||||
import { Palette } from "../../styles";
|
||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||
@@ -85,7 +91,7 @@ const ProjectDropDown = ({
|
||||
onSelectProject?.(project);
|
||||
closeDropdown();
|
||||
},
|
||||
[closeDropdown, onSelectProject],
|
||||
[closeDropdown, onSelectProject]
|
||||
);
|
||||
|
||||
const handleModify = useCallback(
|
||||
@@ -93,7 +99,7 @@ const ProjectDropDown = ({
|
||||
if (!project?.id) return;
|
||||
onModifyProject?.(project, anchor);
|
||||
},
|
||||
[onModifyProject],
|
||||
[onModifyProject]
|
||||
);
|
||||
|
||||
const handleCreate = useCallback(() => {
|
||||
@@ -103,7 +109,7 @@ const ProjectDropDown = ({
|
||||
|
||||
const dropdownWidth = useMemo(
|
||||
() => triggerLayout?.width || 0,
|
||||
[triggerLayout],
|
||||
[triggerLayout]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -121,7 +127,7 @@ const ProjectDropDown = ({
|
||||
inputRange: [0, 1],
|
||||
outputRange: [-12, 0],
|
||||
}),
|
||||
[dropdownAnimation],
|
||||
[dropdownAnimation]
|
||||
);
|
||||
|
||||
const overlayScale = useMemo(
|
||||
@@ -130,7 +136,7 @@ const ProjectDropDown = ({
|
||||
inputRange: [0, 1],
|
||||
outputRange: [0.96, 1],
|
||||
}),
|
||||
[dropdownAnimation],
|
||||
[dropdownAnimation]
|
||||
);
|
||||
|
||||
const triggerOpacity = useMemo(
|
||||
@@ -140,7 +146,7 @@ const ProjectDropDown = ({
|
||||
outputRange: [1, 0],
|
||||
extrapolate: "clamp",
|
||||
}),
|
||||
[dropdownAnimation],
|
||||
[dropdownAnimation]
|
||||
);
|
||||
|
||||
const triggerTranslateY = useMemo(
|
||||
@@ -149,7 +155,7 @@ const ProjectDropDown = ({
|
||||
inputRange: [0, 1],
|
||||
outputRange: [0, -6],
|
||||
}),
|
||||
[dropdownAnimation],
|
||||
[dropdownAnimation]
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -309,7 +315,7 @@ const ProjectRow = ({
|
||||
(typeof project?.cover === "string" ? project.cover : project?.cover?.uri);
|
||||
const imageSource = useMemo(
|
||||
() => (coverUri ? { uri: coverUri } : img.placeholder),
|
||||
[coverUri],
|
||||
[coverUri]
|
||||
);
|
||||
const title =
|
||||
project?.title || (isEmptyProject ? "Nouvelle musique" : "Sans titre");
|
||||
|
||||
@@ -28,14 +28,6 @@ const CREATE_DATA = [
|
||||
desc: "Come back, when\nyou’ll have lyrics!",
|
||||
type: "Beatmaker",
|
||||
},
|
||||
{
|
||||
stageKey: "designer",
|
||||
img: ai.bena,
|
||||
bg: background.productionBG,
|
||||
label: "Bena",
|
||||
desc: "Come back when you want\nto generate cover!",
|
||||
type: "Designer",
|
||||
},
|
||||
{
|
||||
stageKey: "director",
|
||||
img: ai.john,
|
||||
|
||||
@@ -10,7 +10,6 @@ import GradientButton from "../../components/GradientButton";
|
||||
import ValidateModal from "../../components/modal/ValidateModal";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import Slider from "../../components/Slider";
|
||||
import firebase from "../../config/firebase";
|
||||
import alert from "../../components/Alert";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import Page from "../../layouts/Page";
|
||||
@@ -154,7 +153,12 @@ const SongReady = () => {
|
||||
await updateProjectData({
|
||||
songIndex: selectedIndex,
|
||||
songUrl: url,
|
||||
updatedAt: firebase.firestore.FieldValue.serverTimestamp(),
|
||||
cover: null,
|
||||
coverUrl: null,
|
||||
coverStatus: null,
|
||||
playbackUrl: null,
|
||||
playbackStatus: null,
|
||||
playbackGenerating: null,
|
||||
});
|
||||
|
||||
// Incrémenter le compteur de chansons générées
|
||||
@@ -168,7 +172,7 @@ const SongReady = () => {
|
||||
|
||||
await player0?.pause?.();
|
||||
await player1?.pause?.();
|
||||
navigate(Routes.Home);
|
||||
navigate(Routes.ChooseCoverType);
|
||||
} catch (e) {
|
||||
console.log("Validate error", e?.message);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import { Routes } from "../navigation/Routes";
|
||||
|
||||
export const CREATION_STAGE_KEYS = [
|
||||
"songwriter",
|
||||
"beatmaker",
|
||||
"designer",
|
||||
"director",
|
||||
];
|
||||
export const CREATION_STAGE_KEYS = ["songwriter", "beatmaker", "director"];
|
||||
|
||||
const getLyricsCount = (project) => {
|
||||
if (!project) return 0;
|
||||
@@ -56,8 +51,6 @@ const getStageLockState = (key, metadata) => {
|
||||
return hasSongUrl;
|
||||
case "beatmaker":
|
||||
return !(lyricsCount > 0 && !hasSongUrl);
|
||||
case "designer":
|
||||
return !(hasSongUrl && hasPlayback);
|
||||
case "director":
|
||||
return !hasCover;
|
||||
default:
|
||||
@@ -73,7 +66,6 @@ const getStageDescription = (key, metadata) => {
|
||||
hasPlaybackAsset,
|
||||
hasMusicDraft,
|
||||
isMusicGenerating,
|
||||
isCoverGenerating,
|
||||
isPlaybackGenerating,
|
||||
} = metadata;
|
||||
|
||||
@@ -97,17 +89,6 @@ const getStageDescription = (key, metadata) => {
|
||||
return "Modifier la production musicale";
|
||||
}
|
||||
return "Commencer la création de votre morceau";
|
||||
case "designer":
|
||||
if (!hasSongUrl) {
|
||||
return "Générez votre morceau avant de créer la cover";
|
||||
}
|
||||
if (isCoverGenerating) {
|
||||
return "Votre cover est en cours de génération";
|
||||
}
|
||||
if (hasCover) {
|
||||
return "Modifier la cover générée";
|
||||
}
|
||||
return "Commencer la création de votre cover";
|
||||
case "director":
|
||||
if (!hasCover) {
|
||||
return "Générez une cover pour débloquer le playback";
|
||||
@@ -134,10 +115,6 @@ const getStageLockedDescription = (key, metadata) => {
|
||||
return metadata.hasSongUrl
|
||||
? "Impossible de modifier la production musicale"
|
||||
: undefined;
|
||||
case "designer":
|
||||
return metadata.hasCover
|
||||
? "Impossible de modifier la cover"
|
||||
: undefined;
|
||||
case "director":
|
||||
return metadata.hasPlaybackAsset
|
||||
? "Impossible de modifier le playback"
|
||||
@@ -153,8 +130,6 @@ const getStageCompletionState = (key, metadata) => {
|
||||
return metadata.hasLyrics;
|
||||
case "beatmaker":
|
||||
return metadata.hasSongUrl || metadata.musicStatus === "GENERATED";
|
||||
case "designer":
|
||||
return metadata.hasCover;
|
||||
case "director":
|
||||
return metadata.hasPlaybackAsset;
|
||||
default:
|
||||
@@ -196,12 +171,6 @@ export const getStageAction = (key, project) => {
|
||||
return { route: Routes.SongReady };
|
||||
}
|
||||
return { route: Routes.Compose };
|
||||
case "designer":
|
||||
return {
|
||||
route: project?.coverUrl
|
||||
? Routes.ValidateCover
|
||||
: Routes.ChooseCoverType,
|
||||
};
|
||||
case "director":
|
||||
return {
|
||||
route: Routes.Playback,
|
||||
|
||||
Reference in New Issue
Block a user