diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-07-02 14:43:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-02 22:43:34 +0100 |
commit | 63bb8fda2d28e11d7e60808e1e86384d48ec1b47 (patch) | |
tree | 077d366a888ceb4c0c925707e2d2989ad7bf7fdb /src/screens/Signup/StepCaptcha/index.tsx | |
parent | 4bb4452f0858f2f5f8f6ead3012307cdf4b6a67f (diff) | |
download | voidsky-63bb8fda2d28e11d7e60808e1e86384d48ec1b47.tar.zst |
Improve textinput performance in login and account creation (#4673)
* Change login form to use uncontrolled inputs * Debounce state updates in account creation to reduce flicker * Refactor state-control of account creation forms to fix perf without relying on debounces * Remove canNext and enforce is13 * Re-add live validation to signup form (#4720) * Update validation in real time * Disable on invalid * Clear server error on typing * Remove unnecessary clearing of error --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/screens/Signup/StepCaptcha/index.tsx')
-rw-r--r-- | src/screens/Signup/StepCaptcha/index.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/screens/Signup/StepCaptcha/index.tsx b/src/screens/Signup/StepCaptcha/index.tsx index b2a91a641..bf3576490 100644 --- a/src/screens/Signup/StepCaptcha/index.tsx +++ b/src/screens/Signup/StepCaptcha/index.tsx @@ -12,6 +12,7 @@ import {useSignupContext, useSubmitSignup} from '#/screens/Signup/state' import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView' import {atoms as a, useTheme} from '#/alf' import {FormError} from '#/components/forms/FormError' +import {BackNextButtons} from '../BackNextButtons' const CAPTCHA_PATH = '/gate/signup' @@ -61,6 +62,16 @@ export function StepCaptcha() { [_, dispatch, state.handle], ) + const onBackPress = React.useCallback(() => { + logger.error('Signup Flow Error', { + errorMessage: + 'User went back from captcha step. Possibly encountered an error.', + registrationHandle: state.handle, + }) + + dispatch({type: 'prev'}) + }, [dispatch, state.handle]) + return ( <ScreenTransition> <View style={[a.gap_lg]}> @@ -86,6 +97,11 @@ export function StepCaptcha() { </View> <FormError error={state.error} /> </View> + <BackNextButtons + hideNext + isLoading={state.isLoading} + onBackPress={onBackPress} + /> </ScreenTransition> ) } |