-
Notifications
You must be signed in to change notification settings - Fork 4k
Verify account for delegate user flow uses navigation modal #68401
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
Merged
mountiny
merged 38 commits into
Expensify:main
from
software-mansion-labs:feat/verify-account-uses-navigation-modal
Sep 11, 2025
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b7cdccf
Verify account uses navidation modal, Copy codes in progress
jmusial 8438b99
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 9b8387e
fix link issue for 2fa
jmusial 0eb3a20
prettier fix
jmusial e612903
remove modal implementation
jmusial 0273f8e
add JSDoc to the useRunOnFirstRender
jmusial f76d104
update dep array
jmusial 8d79824
fix PR comments
jmusial 06c3237
refactor so it does not use back to and forward to urls
jmusial 8559648
remove footer, clear lint errors
jmusial a583cd2
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 581f836
fix lint
jmusial 04f29d9
Remove useless import
jmusial bae8879
revert existing route to still use back to and forward to
jmusial 96e0575
change hook name
jmusial d58c24b
fix prettier
jmusial b41be4d
fix prettier
jmusial 8b07a52
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 82c3a5b
implement url params util
jmusial ae949a1
remove changes connected with two factor auth
jmusial 7f88263
small fixes
jmusial 6f3c04e
cleanup
jmusial 2cd68f0
fix ts
jmusial 6c94062
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 1d790c3
add comment
jmusial 9c22c93
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 08d0654
fix prettier
jmusial 7fd3a68
Merge branch 'main' into feat/verify-account-uses-navigation-modal
mhawryluk ef09552
Merge branch 'main' into feat/verify-account-uses-navigation-modal
mhawryluk 3e124f4
Fix after merge
mhawryluk bdc4921
Fix wrong back button destination when accessing verify-account via a…
mhawryluk 6166cf3
Allow detecting verify account routes with query parameters
mhawryluk b111aaa
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 1ec6a1a
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 49bee79
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 74db137
remove useEffectOnMount and NavigationIsready
jmusial 23c5a62
Update src/ROUTES.ts
jmusial 85ff1d1
Merge branch 'main' into feat/verify-account-uses-navigation-modal
jmusial 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 hidden or 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
This file contains hidden or 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
95 changes: 95 additions & 0 deletions
95
src/components/ValidateCodeActionModal/ValidateCodeActionContent.tsx
This file contains hidden or 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,95 @@ | ||
| import React, {useCallback, useEffect, useRef} from 'react'; | ||
| import {View} from 'react-native'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
| import ScrollView from '@components/ScrollView'; | ||
| import Text from '@components/Text'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type {ValidateCodeActionContentProps} from './type'; | ||
| import ValidateCodeForm from './ValidateCodeForm'; | ||
| import type {ValidateCodeFormHandle} from './ValidateCodeForm/BaseValidateCodeForm'; | ||
|
|
||
| function ValidateCodeActionContent({ | ||
| title, | ||
| descriptionPrimary, | ||
| descriptionSecondary, | ||
| onClose, | ||
| validateError, | ||
| validatePendingAction, | ||
| validateCodeActionErrorField, | ||
| handleSubmitForm, | ||
| clearError, | ||
| sendValidateCode, | ||
| isLoading, | ||
| threeDotsMenuItems = [], | ||
| onThreeDotsButtonPress = () => {}, | ||
| }: ValidateCodeActionContentProps) { | ||
| const themeStyles = useThemeStyles(); | ||
| const validateCodeFormRef = useRef<ValidateCodeFormHandle>(null); | ||
| const [validateCodeAction] = useOnyx(ONYXKEYS.VALIDATE_ACTION_CODE, {canBeMissing: true}); | ||
| const firstRenderRef = useRef(true); | ||
|
|
||
| useEffect(() => { | ||
| if (!firstRenderRef.current || validateCodeAction?.validateCodeSent) { | ||
| return; | ||
| } | ||
| firstRenderRef.current = false; | ||
|
|
||
| sendValidateCode(); | ||
| // We only want to send validate code on first render not on change of validateCodeSent, so we don't add it as a dependency. | ||
| // eslint-disable-next-line react-compiler/react-compiler | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [sendValidateCode]); | ||
|
|
||
| const hide = useCallback(() => { | ||
| clearError(); | ||
| onClose?.(); | ||
| }, [onClose, clearError]); | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| includeSafeAreaPaddingBottom | ||
| includePaddingTop | ||
| shouldEnableMaxHeight | ||
| testID={ValidateCodeActionContent.displayName} | ||
| offlineIndicatorStyle={themeStyles.mtAuto} | ||
| > | ||
| <HeaderWithBackButton | ||
| title={title} | ||
| onBackButtonPress={hide} | ||
| threeDotsMenuItems={threeDotsMenuItems} | ||
| shouldShowThreeDotsButton={threeDotsMenuItems.length > 0} | ||
| shouldOverlayDots | ||
| onThreeDotsButtonPress={onThreeDotsButtonPress} | ||
| /> | ||
|
|
||
| <ScrollView | ||
| style={[themeStyles.w100, themeStyles.h100, themeStyles.flex1]} | ||
| contentContainerStyle={themeStyles.flexGrow1} | ||
| keyboardShouldPersistTaps="handled" | ||
| > | ||
| <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} | ||
| validatePendingAction={validatePendingAction} | ||
| validateCodeActionErrorField={validateCodeActionErrorField} | ||
| validateError={validateError} | ||
| handleSubmitForm={handleSubmitForm} | ||
| sendValidateCode={sendValidateCode} | ||
| clearError={clearError} | ||
| buttonStyles={[themeStyles.justifyContentEnd, themeStyles.flex1]} | ||
| ref={validateCodeFormRef} | ||
| /> | ||
| </View> | ||
| </ScrollView> | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| ValidateCodeActionContent.displayName = 'ValidateCodeActionContent'; | ||
|
|
||
| export default ValidateCodeActionContent; |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.