Refactor app flows and refresh UI components
This commit is contained in:
@@ -13,7 +13,7 @@ import firebase, { getFunctionsClient, projectsRef, serverTimestamp } from '../.
|
||||
import { uploadFileToFirebase } from '../../helpers/uploadToFirebase'
|
||||
import Page from '../../layouts/Page'
|
||||
import { Routes } from '../../navigation'
|
||||
import { goBack, navigate } from '../../navigation/NavigationService'
|
||||
import { navigate } from '../../navigation/NavigationService'
|
||||
import { useUserData, useUser } from '../../providers/UserDataProvider'
|
||||
import { useStripe } from '../../providers/StripeProvider'
|
||||
import { Palette } from '../../styles'
|
||||
@@ -391,6 +391,15 @@ const PlaybackDownload = ({ route }) => {
|
||||
handleDownloadUri()
|
||||
}, [downloadPaymentPending, handleDownloadUri, hasPaidPlaybackDownload, isDownloading])
|
||||
|
||||
const handleGoHome = useCallback(() => {
|
||||
navigate(Routes.BottomTab, {
|
||||
screen: Routes.HomeStack,
|
||||
params: {
|
||||
screen: Routes.Home,
|
||||
},
|
||||
})
|
||||
}, [])
|
||||
|
||||
const handlePublish = async () => {
|
||||
if (!hasAcceptedPublication) return
|
||||
|
||||
@@ -402,6 +411,7 @@ const PlaybackDownload = ({ route }) => {
|
||||
await projectsRef.doc(projectForDownload.id).set(
|
||||
{
|
||||
playbackUrl: url,
|
||||
playbackProvider: 'live',
|
||||
updatedAt: serverTimestamp(),
|
||||
},
|
||||
{ merge: true }
|
||||
@@ -431,7 +441,7 @@ const PlaybackDownload = ({ route }) => {
|
||||
backgroundColor="#07111B"
|
||||
headerType="NONE"
|
||||
>
|
||||
<MusicLandHeader onPressBack={goBack} progress={50} />
|
||||
<MusicLandHeader onPressBack={handleGoHome} progress={50} />
|
||||
<ScrollView contentContainerStyle={styles.container} showsVerticalScrollIndicator={false}>
|
||||
<CreateLyricsHeader title={'Publier ton playback'} />
|
||||
|
||||
@@ -494,6 +504,12 @@ const PlaybackDownload = ({ route }) => {
|
||||
loadingText="Publication en cours..."
|
||||
containerStyle={styles.continueButton}
|
||||
/>
|
||||
<BorderGradientButton
|
||||
title="Retour à l'accueil"
|
||||
onPress={handleGoHome}
|
||||
disabled={isPublishing || isDownloading}
|
||||
containerStyle={styles.homeButton}
|
||||
/>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
</>
|
||||
@@ -562,4 +578,8 @@ const styles = StyleSheet.create({
|
||||
continueButton: {
|
||||
marginTop: 10,
|
||||
},
|
||||
homeButton: {
|
||||
marginTop: 2,
|
||||
marginBottom: 18,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user