This commit is contained in:
Philip Cesar Garay
2025-08-01 21:05:44 +08:00
parent 84fc719a10
commit e22b87bd49
18 changed files with 500 additions and 14 deletions
+88
View File
@@ -0,0 +1,88 @@
import { View, Text, ScrollView, Dimensions } from "react-native";
import React, { useRef, useState } from "react";
import Page from "../../layouts/Page";
import MusicLandHeader from "../../components/MusicLandHeader";
import CreateLyricsHeader from "./components/CreateLyricsHeader";
import GradientButton from "../../components/GradientButton";
import { gutters } from "../../styles";
import { SwiperFlatList } from "react-native-swiper-flatlist";
import Goals from "./Goals";
import { goBack } from "../../navigation/NavigationService";
import SpecificityContext from "./SpecificityContext";
import EmotionConvey from "./EmotionConvey";
const { width } = Dimensions.get("window");
const CreateLyricsWithAi = () => {
const scrollRef = useRef(null);
const [selectedIndex, setSelectedIndex] = useState(0);
const [progress, setProgress] = useState(8);
const onPressNext = () => {
setSelectedIndex(selectedIndex + 1);
setProgress(progress + 8);
scrollRef.current.scrollToIndex({
index: selectedIndex + 1,
animated: true,
});
};
const onPressBack = () => {
if (selectedIndex > 0) {
setSelectedIndex(selectedIndex - 1);
setProgress(progress - 8);
scrollRef.current.scrollToIndex({
index: selectedIndex - 1,
animated: true,
});
} else {
goBack();
}
};
return (
<Page headerType="NONE">
<MusicLandHeader onPressBack={onPressBack} progress={progress} />
<View style={{ flex: 1, marginTop: 16, paddingBottom: gutters, gap: 48 }}>
<View style={{ flex: 1 }}>
<SwiperFlatList
style={{ width, left: -gutters }}
ref={scrollRef}
disableGesture
>
<View
style={{
width: width,
height: "100%",
paddingHorizontal: gutters,
}}
>
<Goals />
</View>
<View
style={{
width: width,
height: "100%",
paddingHorizontal: gutters,
}}
>
<SpecificityContext />
</View>
<View
style={{
width: width,
height: "100%",
paddingHorizontal: gutters,
}}
>
<EmotionConvey />
</View>
</SwiperFlatList>
</View>
<GradientButton title="Suivant" onPress={onPressNext} />
</View>
</Page>
);
};
export default CreateLyricsWithAi;