diff --git a/src/components/GradientButton.js b/src/components/GradientButton.js index aefc304..0b9c38d 100644 --- a/src/components/GradientButton.js +++ b/src/components/GradientButton.js @@ -1,9 +1,9 @@ -import { View, Text, Pressable, Image, FlatList } from "react-native"; import React from "react"; -import { LinearGradient } from "./LinearGradient/LinearGradient"; +import { Image, Pressable, Text } from "react-native"; import { Palette, Style } from "../styles"; import { FONT_FAMILY } from "../styles/Fonts"; import { size } from "../styles/Style"; +import { LinearGradient } from "./LinearGradient/LinearGradient"; const GradientButton = ({ title = "", @@ -13,12 +13,17 @@ const GradientButton = ({ containerStyle = {}, icon, disabled = false, + maxWidth = null, }) => { return ( { // Internal fallback state when not provided by parent const [internalSelected, setInternalSelected] = useState( - variant === "sectioned" ? {} : multiple ? [] : null, + variant === "sectioned" ? {} : multiple ? [] : null ); const selected = selectedProp !== undefined ? selectedProp : internalSelected; const setSelected = @@ -170,11 +170,15 @@ const ListSelection = ({ ); }} renderSectionHeader={({ section: { title } }) => ( - + { return ( - + { + const { isWeb } = useLayoutType(); const { selectedProject, updateProjectData } = useUser(); const hasLyrics = selectedProject?.hasLyrics === true; const scrollRef = useRef(null); const [selectedIndex, setSelectedIndex] = useState(hasLyrics ? 5 : 0); const [progress, setProgress] = useState(16); const [parentLayout, setparentLayout] = useState(null); + const containerWidth = isWeb ? parentLayout?.width : windowWidth; // Collected state across steps const [objective, setObjective] = useState(null); // from Goals list @@ -162,12 +165,16 @@ const CreateLyricsWithAi = () => { const isNextDisabled = React.useMemo(() => { switch (selectedIndex) { case 0: { - const hasObjective = typeof objective === "string" && objective.length > 0; - const hasOther = typeof otherObjective === "string" && otherObjective.trim().length > 0; + const hasObjective = + typeof objective === "string" && objective.length > 0; + const hasOther = + typeof otherObjective === "string" && + otherObjective.trim().length > 0; return !(hasObjective || hasOther); } case 1: { - const hasContext = typeof context === "string" && context.trim().length > 0; + const hasContext = + typeof context === "string" && context.trim().length > 0; return !hasContext; } case 2: { @@ -178,15 +185,18 @@ const CreateLyricsWithAi = () => { } case 3: { const hasStyle = typeof style === "string" && style.length > 0; - const hasOther = typeof otherStyle === "string" && otherStyle.trim().length > 0; + const hasOther = + typeof otherStyle === "string" && otherStyle.trim().length > 0; return !(hasStyle || hasOther); } case 4: { - const hasAudience = typeof audience === "string" && audience.trim().length > 0; + const hasAudience = + typeof audience === "string" && audience.trim().length > 0; return !hasAudience; } case 5: { - const hasStructure = typeof structure === "string" && structure.length > 0; + const hasStructure = + typeof structure === "string" && structure.length > 0; return !hasStructure; } case 7: { @@ -196,7 +206,18 @@ const CreateLyricsWithAi = () => { default: return false; } - }, [selectedIndex, objective, otherObjective, context, emotion, style, otherStyle, audience, structure, rhymes]); + }, [ + selectedIndex, + objective, + otherObjective, + context, + emotion, + style, + otherStyle, + audience, + structure, + rhymes, + ]); const onPressNext = async () => { // Si l'utilisateur a déjà des paroles et vient de finir CustomizeSongStructure (index 6), @@ -260,6 +281,7 @@ const CreateLyricsWithAi = () => { headerType="NONE" behavior={Platform.OS === "ios" ? "padding" : "height"} keyboardVerticalOffset={Platform.OS === "ios" ? 64 : 100} + backgroundImg={background.homeBG} > { onLayout={(e) => setparentLayout(e.nativeEvent.layout)} > { { { { { { { { { {selectedIndex !== 8 && ( )} diff --git a/src/screens/Writing/Goals.js b/src/screens/Writing/Goals.js index 82a739a..cc3d00d 100644 --- a/src/screens/Writing/Goals.js +++ b/src/screens/Writing/Goals.js @@ -1,12 +1,12 @@ -import { View, StyleSheet } from "react-native"; import React, { useState } from "react"; -import CreateLyricsHeader from "./components/CreateLyricsHeader"; -import { Palette } from "../../styles"; -import { GOALS } from "../../data/data"; -import { FONT_FAMILY } from "../../styles/Fonts"; -import CustomInput from "./components/CustomInput"; +import { StyleSheet, View } from "react-native"; import ItemContainer from "../../components/ItemContainer/ItemContainer"; import ListSelection from "../../components/ListSelection/ListSelection"; +import { GOALS } from "../../data/data"; +import { Palette } from "../../styles"; +import { FONT_FAMILY } from "../../styles/Fonts"; +import CreateLyricsHeader from "./components/CreateLyricsHeader"; +import CustomInput from "./components/CustomInput"; const Goals = ({ selected: selectedProp, @@ -24,7 +24,7 @@ const Goals = ({ return ( - +