Revert animation change in signup (#4693)

zio/stable
Hailey 2024-06-27 22:01:02 -07:00 committed by GitHub
parent 8ebf9cc4b1
commit 58a97db5b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 26 deletions

View File

@ -1,5 +1,5 @@
import React, {useEffect} from 'react' import React from 'react'
import {LayoutAnimation, View} from 'react-native' import {View} from 'react-native'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@ -35,10 +35,6 @@ export function StepInfo({
const {_} = useLingui() const {_} = useLingui()
const {state, dispatch} = useSignupContext() const {state, dispatch} = useSignupContext()
useEffect(() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
}, [state.isLoading, isLoadingStarterPack])
return ( return (
<ScreenTransition> <ScreenTransition>
<View style={[a.gap_md]}> <View style={[a.gap_md]}>

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {LayoutAnimationConfig} from 'react-native-reanimated' import Animated, {FadeIn, LayoutAnimationConfig} from 'react-native-reanimated'
import {AppBskyGraphStarterpack} from '@atproto/api' import {AppBskyGraphStarterpack} from '@atproto/api'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@ -50,6 +50,8 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
} = useStarterPackQuery({ } = useStarterPackQuery({
uri: activeStarterPack?.uri, uri: activeStarterPack?.uri,
}) })
const [isFetchedAtMount] = React.useState(starterPack != null)
const showStarterPackCard = const showStarterPackCard =
activeStarterPack?.uri && !isFetchingStarterPack && starterPack activeStarterPack?.uri && !isFetchingStarterPack && starterPack
@ -159,25 +161,27 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
<View testID="createAccount" style={a.flex_1}> <View testID="createAccount" style={a.flex_1}>
{showStarterPackCard && {showStarterPackCard &&
AppBskyGraphStarterpack.isRecord(starterPack.record) ? ( AppBskyGraphStarterpack.isRecord(starterPack.record) ? (
<LinearGradientBackground <Animated.View entering={!isFetchedAtMount ? FadeIn : undefined}>
style={[a.mx_lg, a.p_lg, a.gap_sm, a.rounded_sm]}> <LinearGradientBackground
<Text style={[a.font_bold, a.text_xl, {color: 'white'}]}> style={[a.mx_lg, a.p_lg, a.gap_sm, a.rounded_sm]}>
{starterPack.record.name} <Text style={[a.font_bold, a.text_xl, {color: 'white'}]}>
</Text> {starterPack.record.name}
<Text style={[{color: 'white'}]}> </Text>
{starterPack.feeds?.length ? ( <Text style={[{color: 'white'}]}>
<Trans> {starterPack.feeds?.length ? (
You'll follow the suggested users and feeds once you finish <Trans>
creating your account! You'll follow the suggested users and feeds once you
</Trans> finish creating your account!
) : ( </Trans>
<Trans> ) : (
You'll follow the suggested users once you finish creating <Trans>
your account! You'll follow the suggested users once you finish creating
</Trans> your account!
)} </Trans>
</Text> )}
</LinearGradientBackground> </Text>
</LinearGradientBackground>
</Animated.View>
) : null} ) : null}
<View <View
style={[ style={[

View File

@ -116,6 +116,8 @@ export function reducer(s: SignupState, a: SignupAction): SignupState {
break break
} }
case 'setServiceDescription': { case 'setServiceDescription': {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
next.serviceDescription = a.value next.serviceDescription = a.value
next.userDomain = a.value?.availableUserDomains[0] ?? '' next.userDomain = a.value?.availableUserDomains[0] ?? ''
next.isLoading = false next.isLoading = false