From 8ebf9cc4b10a620d7698c1b0d0b316729c02dc13 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 27 Jun 2024 21:44:26 -0700 Subject: Handle pushing to starterpack screen when unauthed (#4692) --- src/screens/Signup/index.tsx | 63 +++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'src/screens/Signup/index.tsx') diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index 3203d443c..2ccb38846 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -1,10 +1,6 @@ import React from 'react' import {View} from 'react-native' -import Animated, { - FadeIn, - FadeOut, - LayoutAnimationConfig, -} from 'react-native-reanimated' +import {LayoutAnimationConfig} from 'react-native-reanimated' import {AppBskyGraphStarterpack} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -47,9 +43,15 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { const agent = useAgent() const activeStarterPack = useActiveStarterPack() - const {data: starterPack} = useStarterPackQuery({ + const { + data: starterPack, + isFetching: isFetchingStarterPack, + isError: isErrorStarterPack, + } = useStarterPackQuery({ uri: activeStarterPack?.uri, }) + const showStarterPackCard = + activeStarterPack?.uri && !isFetchingStarterPack && starterPack const { data: serviceInfo, @@ -155,30 +157,27 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { description={_(msg`We're so excited to have you join us!`)} scrollable> - {state.activeStep === SignupStep.INFO && - starterPack && + {showStarterPackCard && AppBskyGraphStarterpack.isRecord(starterPack.record) ? ( - - - - {starterPack.record.name} - - - {starterPack.feeds?.length ? ( - - You'll follow the suggested users and feeds once you - finish creating your account! - - ) : ( - - You'll follow the suggested users once you finish creating - your account! - - )} - - - + + + {starterPack.record.name} + + + {starterPack.feeds?.length ? ( + + You'll follow the suggested users and feeds once you finish + creating your account! + + ) : ( + + You'll follow the suggested users once you finish creating + your account! + + )} + + ) : null} void}) { {state.activeStep === SignupStep.INFO ? ( - + ) : state.activeStep === SignupStep.HANDLE ? ( ) : ( -- cgit 1.4.1