fix tickets add reort mail and design fixes
This commit is contained in:
@@ -6,8 +6,7 @@ import GradientButton from "../../components/GradientButton";
|
||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||
import { OTHER_OBJECTIVE_OPTION, OTHER_STYLE_OPTION } from "../../data/data";
|
||||
import Page from "../../layouts/Page";
|
||||
import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { goBack } from "../../navigation/NavigationService";
|
||||
import { useUser } from "../../providers/UserDataProvider";
|
||||
import { gutters } from "../../styles";
|
||||
import { sanitizeStructureList } from "../../utils/songStructure";
|
||||
@@ -21,10 +20,11 @@ import SongStyle from "./SongStyle";
|
||||
import SongTo from "./SongTo";
|
||||
import SpecificityContext from "./SpecificityContext";
|
||||
|
||||
const MAX_STEP_INDEX = 8;
|
||||
|
||||
const CreateLyricsWithAi = () => {
|
||||
const { selectedProject, updateProjectData } = useUser();
|
||||
const hasLyrics = selectedProject?.hasLyrics === true;
|
||||
const [selectedIndex, setSelectedIndex] = useState(hasLyrics ? 5 : 0);
|
||||
const { selectedProject } = useUser();
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
|
||||
// Collected state across steps
|
||||
const [objective, setObjective] = useState(null); // from Goals list
|
||||
@@ -187,13 +187,6 @@ const CreateLyricsWithAi = () => {
|
||||
}
|
||||
}, [structure]);
|
||||
|
||||
// Si déjà des paroles, forcer l'accès à partir de l'étape 5 et ignorer 0-4
|
||||
React.useEffect(() => {
|
||||
if (hasLyrics && selectedIndex < 5) {
|
||||
setSelectedIndex(5);
|
||||
}
|
||||
}, [hasLyrics]);
|
||||
|
||||
const progress = useMemo(
|
||||
() => 16 + selectedIndex * 9,
|
||||
[selectedIndex]
|
||||
@@ -301,37 +294,7 @@ const CreateLyricsWithAi = () => {
|
||||
]);
|
||||
|
||||
const onPressNext = async () => {
|
||||
// Si l'utilisateur a déjà des paroles et vient de finir CustomizeSongStructure (index 6),
|
||||
// sauter Rhymes et CreatingLyrics et aller directement sur Lyrics
|
||||
if (hasLyrics && selectedIndex === 6) {
|
||||
const chosenStructure = sanitizeStructureList(
|
||||
Array.isArray(customStructure) && customStructure.length > 0
|
||||
? customStructure
|
||||
: Array.isArray(parsedStructure)
|
||||
? parsedStructure
|
||||
: []
|
||||
);
|
||||
await updateProjectData({
|
||||
config: { structure: chosenStructure },
|
||||
selections: {
|
||||
objective,
|
||||
otherObjective: persistedOtherObjective,
|
||||
context,
|
||||
emotion,
|
||||
style,
|
||||
otherStyle: persistedOtherStyle,
|
||||
audience,
|
||||
structure,
|
||||
parsedStructure,
|
||||
customStructure: sanitizeStructureList(customStructure),
|
||||
rhymes,
|
||||
},
|
||||
hasLyrics: true,
|
||||
});
|
||||
navigate(Routes.Lyrics);
|
||||
return;
|
||||
}
|
||||
setSelectedIndex((idx) => idx + 1);
|
||||
setSelectedIndex((idx) => Math.min(idx + 1, MAX_STEP_INDEX));
|
||||
};
|
||||
|
||||
const onPressBack = () => {
|
||||
|
||||
Reference in New Issue
Block a user