feat: assets
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { View } from 'react-native'
|
||||
import { useIsFocused } from '@react-navigation/native'
|
||||
import { useIsFocused, useRoute } from '@react-navigation/native'
|
||||
import { background } from '../../assets'
|
||||
import FullscreenIntroVideo from '../../components/FullscreenIntroVideo'
|
||||
import GradientButton from '../../components/GradientButton'
|
||||
@@ -15,16 +15,31 @@ import { isWeb } from '../../hooks/useLayoutType'
|
||||
const Compose = () => {
|
||||
const { videos } = useUserData()
|
||||
const isFocused = useIsFocused()
|
||||
const route = useRoute()
|
||||
const fromLyrics = route?.params?.fromLyrics === true
|
||||
|
||||
const [videoUrl, setVideoUrl] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
setVideoUrl(isWeb ? videos.malikWeb : videos?.malik)
|
||||
}, [])
|
||||
|
||||
const handleBack = () => {
|
||||
if (fromLyrics) {
|
||||
navigate(Routes.BottomTab, {
|
||||
screen: Routes.HomeStack,
|
||||
params: {
|
||||
screen: Routes.Home,
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
goBack()
|
||||
}
|
||||
return (
|
||||
<Page backgroundImg={background.studioBG2} headerType="NONE">
|
||||
<MusicLandHeader
|
||||
onPressBack={goBack}
|
||||
onPressBack={handleBack}
|
||||
progress={9}
|
||||
// logo={icons.musicLandStudio}
|
||||
/>
|
||||
@@ -38,7 +53,7 @@ const Compose = () => {
|
||||
>
|
||||
<GradientButton
|
||||
title="Composer ma chanson"
|
||||
onPress={() => navigate(Routes.ComposeSong)}
|
||||
onPress={() => navigate(Routes.ComposeSong, fromLyrics ? { fromLyrics: true } : undefined)}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -54,6 +54,7 @@ const ComposeSong = () => {
|
||||
const [isConfirmVisible, setIsConfirmVisible] = useState(false)
|
||||
const [isProcessingConfirmation, setIsProcessingConfirmation] = useState(false)
|
||||
const isRegenerationFlow = route?.params?.isRegeneration === true
|
||||
const fromLyrics = route?.params?.fromLyrics === true
|
||||
|
||||
const coinBalance = useMemo(() => {
|
||||
const value = currentUserData?.coins
|
||||
@@ -221,6 +222,15 @@ const ComposeSong = () => {
|
||||
animated: true,
|
||||
})
|
||||
} else {
|
||||
if (fromLyrics) {
|
||||
navigate(Routes.BottomTab, {
|
||||
screen: Routes.HomeStack,
|
||||
params: {
|
||||
screen: Routes.Home,
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ const ComposeSong = () => {
|
||||
const [isConfirmVisible, setIsConfirmVisible] = useState(false)
|
||||
const [isProcessingConfirmation, setIsProcessingConfirmation] = useState(false)
|
||||
const isRegenerationFlow = route?.params?.isRegeneration === true
|
||||
const fromLyrics = route?.params?.fromLyrics === true
|
||||
|
||||
const coinBalance = useMemo(() => {
|
||||
const value = currentUserData?.coins
|
||||
@@ -273,6 +274,15 @@ const ComposeSong = () => {
|
||||
if (selectedIndex > 0) {
|
||||
setSelectedIndex((prev) => Math.max(prev - 1, 0))
|
||||
} else {
|
||||
if (fromLyrics) {
|
||||
navigate(Routes.BottomTab, {
|
||||
screen: Routes.HomeStack,
|
||||
params: {
|
||||
screen: Routes.Home,
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ const CreateLyricsWithAi = () => {
|
||||
: parentLayout?.height
|
||||
|
||||
return (
|
||||
<Page headerType="NONE" backgroundImg={background.writingBG}>
|
||||
<Page headerType="NONE" backgroundImg={background.writingMobileBackground}>
|
||||
<MusicLandHeader onPressBack={onPressBack} progress={progress} />
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
||||
|
||||
@@ -324,12 +324,15 @@ const Lyrics = ({ navigation }) => {
|
||||
const beatmakerStage = getStageAction('beatmaker', projectForStage)
|
||||
setIsBlockingUI(false)
|
||||
if (hasExistingMusicDraft) {
|
||||
navigate(Routes.ComposeSong, { isRegeneration: true })
|
||||
navigate(Routes.ComposeSong, { isRegeneration: true, fromLyrics: true })
|
||||
return
|
||||
}
|
||||
const handleNavigateToStudio = () => {
|
||||
const targetRoute = beatmakerStage?.route || Routes.Compose
|
||||
navigate(targetRoute, beatmakerStage?.params)
|
||||
navigate(targetRoute, {
|
||||
...(beatmakerStage?.params || {}),
|
||||
fromLyrics: true,
|
||||
})
|
||||
}
|
||||
alert(
|
||||
'Céline',
|
||||
|
||||
@@ -49,7 +49,7 @@ const WritingLyrics = () => {
|
||||
}, [createNewProject, navigate, selectedProjectId, setIsLoading, updateProjectData])
|
||||
|
||||
return (
|
||||
<Page backgroundImg={isWeb ? background.libraryBgWeb : background.writingBG} headerType="NONE">
|
||||
<Page backgroundImg={isWeb ? background.libraryBgWeb : background.writingMobileBackground} headerType="NONE">
|
||||
<MusicLandHeader onPressBack={goBack} />
|
||||
<View style={styles.contentWrapper}>
|
||||
<View style={styles.heroContainer}></View>
|
||||
|
||||
Reference in New Issue
Block a user