From a4eee804e9d784cfee87a8ede7cf2b970ec14d79 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Sun, 6 Oct 2024 11:24:05 -0700 Subject: [PATCH] refactor(auth2): More smoothing out of auth screens (#10895) * refactor(auth): switch to standard formik mode * fix(auth2): fix weird keyboard performance issues * refactor(auth2): more smoothing out * test(auth2): stub out test files * chore(auth2): be sure to dismiss keyboard after each step --- .../Screens/MyCollectionArtworkFormArtist.tsx | 2 +- .../Scenes/Onboarding/Auth2/AuthContext.tsx | 5 +- .../Scenes/Onboarding/Auth2/AuthScenes.tsx | 8 +- .../Auth2/__tests__/AuthApp.test.tsx | 5 + .../Auth2/__tests__/AuthContext.test.tsx | 5 + .../Auth2/__tests__/AuthScenes.test.tsx | 5 + .../Onboarding/Auth2/components/AuthModal.tsx | 4 +- .../components/__tests__/AuthScreen.test.tsx | 5 + .../__tests__/useAuthNavigation.test.tsx | 5 + .../Auth2/hooks/useInputAutofocus.tsx | 10 +- .../Auth2/scenes/ForgotPasswordStep.tsx | 60 +++++----- .../Onboarding/Auth2/scenes/LoginOTPStep.tsx | 61 +++++----- .../Auth2/scenes/LoginPasswordStep.tsx | 111 +++++++++--------- .../{WelcomeStep.tsx => LoginWelcomeStep.tsx} | 108 +++++++++-------- .../Auth2/scenes/SignUpNameStep.tsx | 111 ++++++++++-------- .../Auth2/scenes/SignUpPasswordStep.tsx | 84 +++++++------ .../__tests__/ForgotPasswordStep.test.tsx | 5 + .../scenes/__tests__/LoginOTPStep.test.tsx | 5 + .../__tests__/LoginPasswordStep.test.tsx | 5 + .../__tests__/LoginWelcomeStep.test.tsx | 5 + .../scenes/__tests__/SignUpNameStep.test.tsx | 5 + .../__tests__/SignUpPasswordStep.test.tsx | 5 + .../Onboarding/Auth2/utils/waitForSubmit.tsx | 6 + 23 files changed, 365 insertions(+), 260 deletions(-) create mode 100644 src/app/Scenes/Onboarding/Auth2/__tests__/AuthApp.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/__tests__/AuthScenes.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/components/__tests__/AuthScreen.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/hooks/__tests__/useAuthNavigation.test.tsx rename src/app/Scenes/Onboarding/Auth2/scenes/{WelcomeStep.tsx => LoginWelcomeStep.tsx} (73%) create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/ForgotPasswordStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginOTPStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginPasswordStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginWelcomeStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpNameStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpPasswordStep.test.tsx create mode 100644 src/app/Scenes/Onboarding/Auth2/utils/waitForSubmit.tsx diff --git a/src/app/Scenes/MyCollection/Screens/ArtworkForm/Screens/MyCollectionArtworkFormArtist.tsx b/src/app/Scenes/MyCollection/Screens/ArtworkForm/Screens/MyCollectionArtworkFormArtist.tsx index ec2d1d56e41..83c67716bf6 100644 --- a/src/app/Scenes/MyCollection/Screens/ArtworkForm/Screens/MyCollectionArtworkFormArtist.tsx +++ b/src/app/Scenes/MyCollection/Screens/ArtworkForm/Screens/MyCollectionArtworkFormArtist.tsx @@ -55,7 +55,7 @@ export const MyCollectionArtworkFormArtist: React.FC< } const handleBack = () => { - // TOOD: The state doesn't need to be stored in the global store + // TODO: The state doesn't need to be stored in the global store GlobalStore.actions.myCollection.artwork.resetForm() goBack() } diff --git a/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx b/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx index b00be08721c..80062e1fa86 100644 --- a/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx +++ b/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx @@ -2,8 +2,7 @@ import { OnboardingWebViewRoute } from "app/Scenes/Onboarding/OnboardingWebView" import { action, Action, createContextStore } from "easy-peasy" export type AuthScreens = { - WelcomeStep: undefined - LoginEmailStep: undefined + LoginWelcomeStep: undefined LoginPasswordStep: { email: string } LoginOTPStep: { otpMode: "standard" | "on_demand"; email: string; password: string } ForgotPasswordStep: { requestedPasswordReset: boolean } | undefined @@ -29,7 +28,7 @@ interface AuthContextModel { export const AuthContext = createContextStore({ isMounted: false, - currentScreen: { name: "WelcomeStep" }, + currentScreen: { name: "LoginWelcomeStep" }, previousScreens: [], isModalExpanded: false, diff --git a/src/app/Scenes/Onboarding/Auth2/AuthScenes.tsx b/src/app/Scenes/Onboarding/Auth2/AuthScenes.tsx index 8a84f2239cd..98c5bd1a6e2 100644 --- a/src/app/Scenes/Onboarding/Auth2/AuthScenes.tsx +++ b/src/app/Scenes/Onboarding/Auth2/AuthScenes.tsx @@ -2,17 +2,17 @@ import { AuthScreen } from "app/Scenes/Onboarding/Auth2/components/AuthScreen" import { ForgotPasswordStep } from "app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep" import { LoginOTPStep } from "app/Scenes/Onboarding/Auth2/scenes/LoginOTPStep" import { LoginPasswordStep } from "app/Scenes/Onboarding/Auth2/scenes/LoginPasswordStep" +import { LoginWelcomeStep } from "app/Scenes/Onboarding/Auth2/scenes/LoginWelcomeStep" import { SignUpNameStep } from "app/Scenes/Onboarding/Auth2/scenes/SignUpNameStep" import { SignUpPasswordStep } from "app/Scenes/Onboarding/Auth2/scenes/SignUpPasswordStep" -import { WelcomeStep } from "app/Scenes/Onboarding/Auth2/scenes/WelcomeStep" import { ScrollView } from "react-native-gesture-handler" export const AuthScenes: React.FC = () => { return ( <> - - - + + + diff --git a/src/app/Scenes/Onboarding/Auth2/__tests__/AuthApp.test.tsx b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthApp.test.tsx new file mode 100644 index 00000000000..bf31af8e6ff --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthApp.test.tsx @@ -0,0 +1,5 @@ +describe("AuthApp", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.test.tsx b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.test.tsx new file mode 100644 index 00000000000..65a83c1bc8a --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.test.tsx @@ -0,0 +1,5 @@ +describe("AuthContext", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/__tests__/AuthScenes.test.tsx b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthScenes.test.tsx new file mode 100644 index 00000000000..734866148dd --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthScenes.test.tsx @@ -0,0 +1,5 @@ +describe("AuthScenes", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/components/AuthModal.tsx b/src/app/Scenes/Onboarding/Auth2/components/AuthModal.tsx index 9d6508398b6..a85778f7374 100644 --- a/src/app/Scenes/Onboarding/Auth2/components/AuthModal.tsx +++ b/src/app/Scenes/Onboarding/Auth2/components/AuthModal.tsx @@ -5,7 +5,7 @@ import { Dimensions, KeyboardAvoidingView, Platform } from "react-native" import { Easing } from "react-native-reanimated" const HEIGHT = { - WelcomeStep: 320, + LoginWelcomeStep: 320, LoginEmailStep: 320, LoginPasswordStep: 320, ForgotPasswordStep: 320, @@ -25,7 +25,7 @@ export const AuthModal: React.FC = ({ children }) => { const height = (() => { if (isModalExpanded) { - return HEIGHT[currentScreen?.name ?? "WelcomeStep"] + return HEIGHT[currentScreen?.name ?? "LoginWelcomeStep"] } return HEIGHT.collapsed diff --git a/src/app/Scenes/Onboarding/Auth2/components/__tests__/AuthScreen.test.tsx b/src/app/Scenes/Onboarding/Auth2/components/__tests__/AuthScreen.test.tsx new file mode 100644 index 00000000000..470867d1da0 --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/components/__tests__/AuthScreen.test.tsx @@ -0,0 +1,5 @@ +describe("AuthScreen", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/hooks/__tests__/useAuthNavigation.test.tsx b/src/app/Scenes/Onboarding/Auth2/hooks/__tests__/useAuthNavigation.test.tsx new file mode 100644 index 00000000000..0ca34a6d9ef --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/hooks/__tests__/useAuthNavigation.test.tsx @@ -0,0 +1,5 @@ +describe("useAuthNavigation", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus.tsx b/src/app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus.tsx index 015f7b53513..2486006971f 100644 --- a/src/app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus.tsx +++ b/src/app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus.tsx @@ -14,7 +14,7 @@ export const useInputAutofocus = ({ screenName, inputRef, enabled = true, - delay = 0, + delay = 100, }: UseInputAutofocusProps) => { const currentScreen = useAuthScreen() @@ -27,10 +27,16 @@ export const useInputAutofocus = ({ return } + let timeout: NodeJS.Timeout + requestAnimationFrame(() => { - setTimeout(() => { + timeout = setTimeout(() => { inputRef.current?.focus() }, delay) }) + + return () => { + clearTimeout(timeout) + } }, [currentScreen]) } diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep.tsx index 1b54177bc91..20661056660 100644 --- a/src/app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep.tsx +++ b/src/app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep.tsx @@ -5,7 +5,7 @@ import { } from "app/Scenes/Onboarding/Auth2/hooks/useAuthNavigation" import { useInputAutofocus } from "app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus" import { GlobalStore } from "app/store/GlobalStore" -import { FormikProvider, useFormik, useFormikContext } from "formik" +import { Formik, useFormikContext } from "formik" import { useRef } from "react" import * as Yup from "yup" @@ -16,38 +16,36 @@ interface ForgotPasswordStepFormValues { export const ForgotPasswordStep: React.FC = () => { const navigation = useAuthNavigation() - const formik = useFormik({ - initialValues: { email: "" }, - onSubmit: async ({ email }, { setErrors, resetForm }) => { - const res = await GlobalStore.actions.auth.forgotPassword({ - email, - }) - if (!res) { - // For security purposes, we are returning a generic error message - setErrors({ - email: - "Couldn’t send reset password link. Please try again, or contact support@artsy.net", - }) - } else { - navigation.navigate({ - name: "ForgotPasswordStep", - params: { requestedPasswordReset: true }, + return ( + + initialValues={{ email: "" }} + onSubmit={async ({ email }, { setErrors, resetForm }) => { + const res = await GlobalStore.actions.auth.forgotPassword({ + email, }) - resetForm() - } - }, - validationSchema: Yup.object().shape({ - email: Yup.string() - .email("Please provide a valid email address") - .required("Email field is required"), - }), - }) - - return ( - + if (!res) { + setErrors({ + email: + "Couldn’t send reset password link. Please try again, or contact support@artsy.net", + }) + } else { + navigation.navigate({ + name: "ForgotPasswordStep", + params: { requestedPasswordReset: true }, + }) + + resetForm() + } + }} + validationSchema={Yup.object().shape({ + email: Yup.string() + .email("Please provide a valid email address") + .required("Email field is required"), + })} + > - + ) } @@ -145,7 +143,7 @@ const ForgotPasswordStepForm: React.FC = () => { - + diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/SignUpNameStep.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/SignUpNameStep.tsx index 86be5524f21..1d91f272f11 100644 --- a/src/app/Scenes/Onboarding/Auth2/scenes/SignUpNameStep.tsx +++ b/src/app/Scenes/Onboarding/Auth2/scenes/SignUpNameStep.tsx @@ -5,12 +5,13 @@ import { useAuthScreen, } from "app/Scenes/Onboarding/Auth2/hooks/useAuthNavigation" import { useInputAutofocus } from "app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus" +import { waitForSubmit } from "app/Scenes/Onboarding/Auth2/utils/waitForSubmit" import { OnboardingNavigationStack } from "app/Scenes/Onboarding/Onboarding" import { EmailSubscriptionCheckbox } from "app/Scenes/Onboarding/OnboardingCreateAccount/EmailSubscriptionCheckbox" import { TermsOfServiceCheckbox } from "app/Scenes/Onboarding/OnboardingCreateAccount/TermsOfServiceCheckbox" import { GlobalStore } from "app/store/GlobalStore" import { showBlockedAuthError } from "app/utils/auth/authHelpers" -import { FormikProvider, useFormik, useFormikContext } from "formik" +import { Formik, useFormikContext } from "formik" import React, { useRef, useState } from "react" import { Alert, Keyboard } from "react-native" import * as Yup from "yup" @@ -24,51 +25,67 @@ interface SignUpNameStepFormValues { export const SignUpNameStep: React.FC = () => { const screen = useAuthScreen() - const formik = useFormik({ - initialValues: { name: "", acceptedTerms: false, agreedToReceiveEmails: false }, - onSubmit: async ({ acceptedTerms, agreedToReceiveEmails, name }, { resetForm }) => { - if (!acceptedTerms) { - return - } - - const res = await GlobalStore.actions.auth.signUp({ - oauthProvider: "email", - oauthMode: "email", - email: screen.params?.email, - password: screen.params?.password, - name: name.trim(), - agreedToReceiveEmails, - }) - - if (!res.success) { - if (res.error === "blocked_attempt") { - showBlockedAuthError("sign up") - } else { - Alert.alert("Try again", res.message) + return ( + + initialValues={{ + name: "", + acceptedTerms: false, + agreedToReceiveEmails: false, + }} + validateOnChange={false} + validationSchema={Yup.object().shape({ + name: Yup.string().trim().required("Full name field is required"), + })} + onSubmit={async (values, { resetForm }) => { + if (!values.acceptedTerms) { + return } - } - - if (res.success) { - resetForm() - } - }, - validationSchema: Yup.object().shape({ - name: Yup.string().trim().required("Full name field is required"), - }), - }) - return ( - + Keyboard.dismiss() + + const res = await GlobalStore.actions.auth.signUp({ + oauthProvider: "email", + oauthMode: "email", + email: screen.params?.email, + password: screen.params?.password, + name: values.name.trim(), + agreedToReceiveEmails: values.agreedToReceiveEmails, + }) + + await waitForSubmit() + + if (!res.success) { + if (res.error === "blocked_attempt") { + showBlockedAuthError("sign up") + } else { + Alert.alert("Try again", res.message) + } + } + + if (res.success) { + resetForm() + } + }} + > - + ) } const SignUpNameStepForm: React.FC = () => { const [highlightTerms, setHighlightTerms] = useState(false) - const { errors, handleChange, handleSubmit, isValid, setErrors, setFieldValue, values } = - useFormikContext() + const { + errors, + handleChange, + handleSubmit, + isSubmitting, + isValid, + resetForm, + setErrors, + setFieldValue, + values, + } = useFormikContext() const navigation = useAuthNavigation() const parentNavigation = useNavigation>() @@ -82,6 +99,7 @@ const SignUpNameStepForm: React.FC = () => { const handleBackButtonPress = () => { navigation.goBack() + resetForm() } return ( @@ -96,13 +114,15 @@ const SignUpNameStepForm: React.FC = () => { autoCapitalize="words" autoComplete="name" autoCorrect={false} - blurOnSubmit={false} + blurOnSubmit error={errors.name} maxLength={128} placeholder="First and last name" placeholderTextColor={color("black30")} ref={nameRef} returnKeyType="done" + spellCheck={false} + textContentType="none" title="Full Name" value={values.name} onChangeText={(text) => { @@ -114,14 +134,11 @@ const SignUpNameStepForm: React.FC = () => { handleChange("name")(text) }} onSubmitEditing={() => { - Keyboard.dismiss() - requestAnimationFrame(() => { - if (values.acceptedTerms) { - handleSubmit() - } else { - setHighlightTerms(true) - } - }) + if (values.acceptedTerms) { + handleSubmit() + } else { + setHighlightTerms(true) + } }} /> @@ -141,7 +158,7 @@ const SignUpNameStepForm: React.FC = () => { /> - diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/SignUpPasswordStep.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/SignUpPasswordStep.tsx index f02ada854f8..d0991b73b9e 100644 --- a/src/app/Scenes/Onboarding/Auth2/scenes/SignUpPasswordStep.tsx +++ b/src/app/Scenes/Onboarding/Auth2/scenes/SignUpPasswordStep.tsx @@ -3,8 +3,11 @@ import { useAuthNavigation, useAuthScreen, } from "app/Scenes/Onboarding/Auth2/hooks/useAuthNavigation" -import { FormikProvider, useFormik, useFormikContext } from "formik" -import React from "react" +import { useInputAutofocus } from "app/Scenes/Onboarding/Auth2/hooks/useInputAutofocus" +import { waitForSubmit } from "app/Scenes/Onboarding/Auth2/utils/waitForSubmit" +import { Formik, useFormikContext } from "formik" +import React, { useRef } from "react" +import { Keyboard } from "react-native" import * as Yup from "yup" interface SignUpPasswordStepFormValues { @@ -15,43 +18,58 @@ export const SignUpPasswordStep: React.FC = () => { const navigation = useAuthNavigation() const screen = useAuthScreen() - const formik = useFormik({ - initialValues: { password: "" }, - onSubmit: ({ password }, { resetForm }) => { - navigation.navigate({ - name: "SignUpNameStep", - params: { - email: screen.params?.email, - password: password, - }, - }) - - resetForm() - }, - validationSchema: Yup.object().shape({ - password: Yup.string() - .min(8, "Your password should be at least 8 characters") - .matches(/[A-Z]/, "Your password should contain at least one uppercase letter") - .matches(/[a-z]/, "Your password should contain at least one lowercase letter") - .matches(/[0-9]/, "Your password should contain at least one digit") - .required("Password field is required"), - }), - }) - return ( - + + initialValues={{ password: "" }} + validationSchema={Yup.object().shape({ + password: Yup.string() + .min(8, "Your password should be at least 8 characters") + .matches(/[A-Z]/, "Your password should contain at least one uppercase letter") + .matches(/[a-z]/, "Your password should contain at least one lowercase letter") + .matches(/[0-9]/, "Your password should contain at least one digit") + .required("Password field is required"), + })} + onSubmit={async ({ password }, { resetForm }) => { + Keyboard.dismiss() + + await waitForSubmit() + + navigation.navigate({ + name: "SignUpNameStep", + params: { + email: screen.params?.email, + password, + }, + }) + + resetForm() + }} + > - + ) } const SignUpPasswordStepForm: React.FC = () => { - const { errors, handleChange, handleSubmit, isValid, setErrors, values, resetForm } = - useFormikContext() + const { + errors, + handleChange, + handleSubmit, + isSubmitting, + isValid, + setErrors, + values, + resetForm, + } = useFormikContext() const navigation = useAuthNavigation() - const { color } = useTheme() + const passwordRef = useRef(null) + + useInputAutofocus({ + screenName: "SignUpPasswordStep", + inputRef: passwordRef, + }) const handleBackButtonPress = () => { navigation.goBack() @@ -70,13 +88,13 @@ const SignUpPasswordStepForm: React.FC = () => { autoCapitalize="none" autoComplete="password" autoCorrect={false} - blurOnSubmit={false} error={errors.password} placeholder="Password" placeholderTextColor={color("black30")} + ref={passwordRef} returnKeyType="done" secureTextEntry - textContentType="password" + textContentType="none" title="Password" value={values.password} onChangeText={(text) => { @@ -93,7 +111,7 @@ const SignUpPasswordStepForm: React.FC = () => { - diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/ForgotPasswordStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/ForgotPasswordStep.test.tsx new file mode 100644 index 00000000000..734f3ced12b --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/ForgotPasswordStep.test.tsx @@ -0,0 +1,5 @@ +describe("ForgotPasswordStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginOTPStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginOTPStep.test.tsx new file mode 100644 index 00000000000..3c49297b976 --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginOTPStep.test.tsx @@ -0,0 +1,5 @@ +describe("LoginOTPStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginPasswordStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginPasswordStep.test.tsx new file mode 100644 index 00000000000..3d8b70221e1 --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginPasswordStep.test.tsx @@ -0,0 +1,5 @@ +describe("LoginPasswordStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginWelcomeStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginWelcomeStep.test.tsx new file mode 100644 index 00000000000..a926a7741b8 --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/LoginWelcomeStep.test.tsx @@ -0,0 +1,5 @@ +describe("LoginWelcomeStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpNameStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpNameStep.test.tsx new file mode 100644 index 00000000000..28b1b9db523 --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpNameStep.test.tsx @@ -0,0 +1,5 @@ +describe("SignUpNameStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpPasswordStep.test.tsx b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpPasswordStep.test.tsx new file mode 100644 index 00000000000..ef21811df5c --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/scenes/__tests__/SignUpPasswordStep.test.tsx @@ -0,0 +1,5 @@ +describe("SignUpPasswordStep", () => { + it("renders correctly", () => { + // TODO + }) +}) diff --git a/src/app/Scenes/Onboarding/Auth2/utils/waitForSubmit.tsx b/src/app/Scenes/Onboarding/Auth2/utils/waitForSubmit.tsx new file mode 100644 index 00000000000..4fa580630fe --- /dev/null +++ b/src/app/Scenes/Onboarding/Auth2/utils/waitForSubmit.tsx @@ -0,0 +1,6 @@ +/** + * Slight delay to smooth out keyboard transitions between submission steps + */ +export const waitForSubmit = async (delay = 1500) => { + return new Promise((resolve: any) => setTimeout(resolve, delay)) +}