Fix native signup captcha interactions (#11263)
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 {AppState, type AppStateStatus, View} from 'react-native'
|
||||||
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
||||||
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
||||||
@@ -132,10 +132,8 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
return (
|
return (
|
||||||
<Animated.View exiting={native(FadeIn.duration(90))} style={a.flex_1}>
|
<Animated.View exiting={native(FadeIn.duration(90))} style={a.flex_1}>
|
||||||
<SignupContext.Provider value={{state, dispatch}}>
|
<SignupContext.Provider value={{state, dispatch}}>
|
||||||
<KeyboardAvoidingView
|
<SignupKeyboardAvoidingView
|
||||||
behavior="padding"
|
enabled={state.activeStep !== SignupStep.CAPTCHA}>
|
||||||
style={a.flex_1}
|
|
||||||
automaticOffset>
|
|
||||||
<LoggedOutLayout
|
<LoggedOutLayout
|
||||||
leadin=""
|
leadin=""
|
||||||
title={l`Create account`}
|
title={l`Create account`}
|
||||||
@@ -260,8 +258,23 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
</LayoutAnimationConfig>
|
</LayoutAnimationConfig>
|
||||||
</View>
|
</View>
|
||||||
</LoggedOutLayout>
|
</LoggedOutLayout>
|
||||||
</KeyboardAvoidingView>
|
</SignupKeyboardAvoidingView>
|
||||||
</SignupContext.Provider>
|
</SignupContext.Provider>
|
||||||
</Animated.View>
|
</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