Fix native signup captcha interactions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {useEffect, useReducer, useState} from 'react'
|
||||
import {type PropsWithChildren, useEffect, useReducer, useState} from 'react'
|
||||
import {AppState, type AppStateStatus, View} from 'react-native'
|
||||
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
||||
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
||||
@@ -132,10 +132,8 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||
return (
|
||||
<Animated.View exiting={native(FadeIn.duration(90))} style={a.flex_1}>
|
||||
<SignupContext.Provider value={{state, dispatch}}>
|
||||
<KeyboardAvoidingView
|
||||
behavior="padding"
|
||||
style={a.flex_1}
|
||||
automaticOffset>
|
||||
<SignupKeyboardAvoidingView
|
||||
enabled={state.activeStep !== SignupStep.CAPTCHA}>
|
||||
<LoggedOutLayout
|
||||
leadin=""
|
||||
title={l`Create account`}
|
||||
@@ -260,8 +258,23 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||
</LayoutAnimationConfig>
|
||||
</View>
|
||||
</LoggedOutLayout>
|
||||
</KeyboardAvoidingView>
|
||||
</SignupKeyboardAvoidingView>
|
||||
</SignupContext.Provider>
|
||||
</Animated.View>
|
||||
)
|
||||
}
|
||||
|
||||
function SignupKeyboardAvoidingView({
|
||||
children,
|
||||
enabled,
|
||||
}: PropsWithChildren<{enabled: boolean}>) {
|
||||
if (!enabled) {
|
||||
return <View style={a.flex_1}>{children}</View>
|
||||
}
|
||||
|
||||
return (
|
||||
<KeyboardAvoidingView behavior="padding" style={a.flex_1} automaticOffset>
|
||||
{children}
|
||||
</KeyboardAvoidingView>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user