-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:blank page appears in validate code form page #55588
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
6373c37
fix:blank page appears in validate code form page
jacobkim9881 172c7b0
lint: fixed ! assertion error
jacobkim9881 c4e944f
pulled original/main
jacobkim9881 6232476
lint assertion err fixed
jacobkim9881 d216e60
lint disabled prop spreading
jacobkim9881 217ac60
Revert "pulled original/main"
jacobkim9881 622df4f
comment type for ref
jacobkim9881 9f1f207
should resolve() if container is undefined
jacobkim9881 5493c6b
comment about focus trap for animation
jacobkim9881 dd436e9
fix: clicking header back err occurs
jacobkim9881 a404826
clear error only after closing the modal
jacobkim9881 6640264
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 6a12518
lint fixed
jacobkim9881 3f12bb5
Revert "lint fixed"
jacobkim9881 433778f
lint fixed
jacobkim9881 c001758
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 72e88b7
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 0afd14a
moved isVisible in the validate code form
jacobkim9881 9b7b20d
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 c19c2af
hide menu items while sliding out of validate page
jacobkim9881 0c12b86
Revert "hide menu items while sliding out of validate page"
jacobkim9881 b6e0138
fix: trashcan shows as navigating out on mWeb
jacobkim9881 5cce05c
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 426d8be
delete this becuase transition anim works w/o it
jacobkim9881 00d7c51
renamed and deleted ValidateCodeActionWithoutModal
jacobkim9881 8d37911
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 23498e9
lint fixed
jacobkim9881 0d1f9fe
focusTrap not needed in mSafari
jacobkim9881 a317155
fix: keyboard not show on Android app, iOS app
jacobkim9881 5b3af3c
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 e37d564
fix: show remove contact method modal
jacobkim9881 589f444
focusTrap not needed in mSafari
jacobkim9881 0e4b20f
show/hide code form
jacobkim9881 bc83a7b
fix: clear error runs on default contact method too
jacobkim9881 1c0cced
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 91e940d
fix: has 2 isVisible
jacobkim9881 943ce63
not use setState for isValidated
jacobkim9881 a2c3878
created type for ValidateCodeActionForm
jacobkim9881 600d0d5
check isValidated not needed for sendValidateCode
jacobkim9881 3fc7ee4
commeted for cleanup function
jacobkim9881 c715494
not use firstRenderRef
jacobkim9881 ef17df1
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 9b73217
showing button on number pad poped up on iOS mWeb
jacobkim9881 08b8d76
fix: keyboard not show on Android app, iOS app
jacobkim9881 aac99d3
deleted unneeded condition
jacobkim9881 bc398e4
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 3a7ebdf
Merge branch 'd53884-5' of github.com:jacobkim9881/Expensify-App into…
jacobkim9881 35ab2c8
lint
jacobkim9881 f415985
runs clearError() as call back when unmounted
jacobkim9881 09e4bc1
fix: when clicking contact method 2nd time, numpad not showing on And…
jacobkim9881 acdfb6e
control useFocusEffect for BaseValidateCodeForm
jacobkim9881 46fc5ae
control useFocusEffect for BaseValidateCodeForm
jacobkim9881 c563704
Revert "control useFocusEffect for BaseValidateCodeForm"
jacobkim9881 44074dd
Revert "control useFocusEffect for BaseValidateCodeForm"
jacobkim9881 56778e3
Revert "fix: when clicking contact method 2nd time, numpad not showin…
jacobkim9881 d0f1782
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 043e4df
fix: when clicking contact method 2nd time, numpad not showing on An…
jacobkim9881 0eb5dd7
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 caef7cd
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 7bfcb5d
merged #57042: fix: Error text overlap on the magic code input screen…
jacobkim9881 962def0
Revert " fix: when clicking contact method 2nd time, numpad not showi…
jacobkim9881 521653b
Revert "merged #57042: fix: Error text overlap on the magic code inpu…
jacobkim9881 5dec1b7
merged #57042: fix: Error text overlap on the magic code input screen…
jacobkim9881 c9e11ad
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 04a1970
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 6833658
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 e9d0ca3
trapContainer has to exist in the second half of this
jacobkim9881 c9f9ef1
loginData should exist before loginData.validatedDate
jacobkim9881 5a33b5a
Merge branch 'main' of https://github.com/Expensify/App into m53884
jacobkim9881 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React, {forwardRef, useEffect, useRef} from 'react'; | ||
import {View} from 'react-native'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
import Text from '@components/Text'; | ||
import ValidateCodeForm from '@components/ValidateCodeActionModal/ValidateCodeForm'; | ||
import type {ValidateCodeFormHandle} from '@components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import type {ValidateCodeActionFormProps} from './type'; | ||
|
||
function ValidateCodeActionForm({ | ||
descriptionPrimary, | ||
descriptionSecondary, | ||
validatePendingAction, | ||
validateError, | ||
handleSubmitForm, | ||
clearError, | ||
sendValidateCode, | ||
hasMagicCodeBeenSent, | ||
isLoading, | ||
forwardedRef, | ||
}: ValidateCodeActionFormProps) { | ||
const themeStyles = useThemeStyles(); | ||
|
||
const [validateCodeAction] = useOnyx(ONYXKEYS.VALIDATE_ACTION_CODE); | ||
|
||
const isUnmounted = useRef(false); | ||
|
||
useEffect(() => { | ||
sendValidateCode(); | ||
|
||
return () => { | ||
isUnmounted.current = true; | ||
}; | ||
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
useEffect(() => { | ||
return () => { | ||
if (!isUnmounted.current) { | ||
return; | ||
} | ||
clearError(); | ||
}; | ||
}, [clearError]); | ||
|
||
return ( | ||
<View style={[themeStyles.ph5, themeStyles.mt3, themeStyles.mb5, themeStyles.flex1]}> | ||
<Text style={[themeStyles.mb3]}>{descriptionPrimary}</Text> | ||
{!!descriptionSecondary && <Text style={[themeStyles.mb3]}>{descriptionSecondary}</Text>} | ||
<ValidateCodeForm | ||
isLoading={isLoading} | ||
validateCodeAction={validateCodeAction} | ||
validatePendingAction={validatePendingAction} | ||
validateError={validateError} | ||
handleSubmitForm={handleSubmitForm} | ||
sendValidateCode={sendValidateCode} | ||
clearError={clearError} | ||
buttonStyles={[themeStyles.justifyContentEnd, themeStyles.flex1]} | ||
ref={forwardedRef} | ||
hasMagicCodeBeenSent={hasMagicCodeBeenSent} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
ValidateCodeActionForm.displayName = 'ValidateCodeActionForm'; | ||
|
||
export default forwardRef<ValidateCodeFormHandle, ValidateCodeActionFormProps>((props, ref) => ( | ||
<ValidateCodeActionForm | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
forwardedRef={ref} | ||
/> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type {ForwardedRef} from 'react'; | ||
import type {ValidateCodeFormHandle} from '@components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm'; | ||
import type {Errors, PendingAction} from '@src/types/onyx/OnyxCommon'; | ||
|
||
type ValidateCodeActionFormProps = { | ||
/** Primary description of the modal */ | ||
descriptionPrimary: string; | ||
|
||
/** Secondary description of the modal */ | ||
descriptionSecondary?: string | null; | ||
|
||
/** The pending action for submitting form */ | ||
validatePendingAction?: PendingAction | null; | ||
|
||
/** The error of submitting */ | ||
validateError?: Errors; | ||
|
||
/** Function is called when submitting form */ | ||
handleSubmitForm: (validateCode: string) => void; | ||
|
||
/** Function to clear error of the form */ | ||
clearError: () => void; | ||
|
||
/** Function is called when validate code modal is mounted and on magic code resend */ | ||
sendValidateCode: () => void; | ||
|
||
/** If the magic code has been resent previously */ | ||
hasMagicCodeBeenSent?: boolean; | ||
|
||
/** Whether the form is loading or not */ | ||
isLoading?: boolean; | ||
|
||
/** Ref for validate code form */ | ||
forwardedRef: ForwardedRef<ValidateCodeFormHandle>; | ||
}; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export type {ValidateCodeActionFormProps}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacobkim9881 will it cause any issue if we apply it for mweb Safari too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It bothers keyboard showing on mWeb Safari:
REC-20250205094156.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On mWeb Safari, number pad shows at contact method page. It is because of
onActive
event fired by focus trap. Number pad gets ready for putting numbers on the validate form. On the screen, contact method page is seen still but focusing is on validate form. As a result before transition animation shows, number pad shows earlier.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it looks like there are a number of issues with focus traps and mWeb Safari across the app (just search for
isMobileSafari
haha. I think this should be okay for now.