diff --git a/src/assets/UI/writingMobileBackground.png b/src/assets/UI/writingMobileBackground.png new file mode 100644 index 0000000..1570066 Binary files /dev/null and b/src/assets/UI/writingMobileBackground.png differ diff --git a/src/assets/index.js b/src/assets/index.js index e14a0ef..9b752be 100644 --- a/src/assets/index.js +++ b/src/assets/index.js @@ -39,7 +39,7 @@ import undo from './UI/undo.png' import focus from './UI/focus.png' import picture from './UI/picture.png' import screenshot from './UI/screenshot.png' - +import writingMobileBackground from './UI/writingMobileBackground.png' import android from './UI/android.png' import ios from './UI/ios.png' import web from './UI/web.png' @@ -220,6 +220,7 @@ export const background = { playbackBG, playbackBG2, libraryBG, + writingMobileBackground, libraryBgWeb: require('./UI/libraryBgWeb.png'), libraryBG2, libraryBG2Web: require('./UI/libraryBG2Web.png'), diff --git a/src/screens/Studio/Compose.js b/src/screens/Studio/Compose.js index fd38661..755eb1b 100644 --- a/src/screens/Studio/Compose.js +++ b/src/screens/Studio/Compose.js @@ -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 ( @@ -38,7 +53,7 @@ const Compose = () => { > navigate(Routes.ComposeSong)} + onPress={() => navigate(Routes.ComposeSong, fromLyrics ? { fromLyrics: true } : undefined)} /> diff --git a/src/screens/Studio/ComposeSong.js b/src/screens/Studio/ComposeSong.js index b8f6a32..5bcce51 100644 --- a/src/screens/Studio/ComposeSong.js +++ b/src/screens/Studio/ComposeSong.js @@ -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() } } diff --git a/src/screens/Studio/ComposeSong.web.js b/src/screens/Studio/ComposeSong.web.js index ee3a4c1..53f10a9 100644 --- a/src/screens/Studio/ComposeSong.web.js +++ b/src/screens/Studio/ComposeSong.web.js @@ -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() } } diff --git a/src/screens/Writing/CreateLyricsWithAi.js b/src/screens/Writing/CreateLyricsWithAi.js index 6adc694..ec860ce 100644 --- a/src/screens/Writing/CreateLyricsWithAi.js +++ b/src/screens/Writing/CreateLyricsWithAi.js @@ -351,7 +351,7 @@ const CreateLyricsWithAi = () => { : parentLayout?.height return ( - + { 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', diff --git a/src/screens/Writing/WritingLyrics.js b/src/screens/Writing/WritingLyrics.js index 59cf90f..078e584 100644 --- a/src/screens/Writing/WritingLyrics.js +++ b/src/screens/Writing/WritingLyrics.js @@ -49,7 +49,7 @@ const WritingLyrics = () => { }, [createNewProject, navigate, selectedProjectId, setIsLoading, updateProjectData]) return ( - +