-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: main
Are you sure you want to change the base?
Conversation
@hoangzinh Another issue from other branch bother testing. Should we handle this bug too?(If we don't then we can't test on iOS) 2025-01-28.3.18.24.movProcess:
|
App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx Lines 171 to 173 in 433778f
This line makes this issue cc: @nkdengineer |
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@jacobkim9881 is it reproducible if we click on "unverified" contact method in the 1st step? |
@hoangzinh It isn't reproducible if clicking 1st time so it isn't unrelated with the PR. Thanks for clarifying! |
|
||
type ValidateCodeActionProps = ValidateCodeActionModalProps & ValidateCodeActionWithoutModalProps; | ||
|
||
function ValidateCodeActionWithoutModal({ |
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.
Do you have any other names for this component? It seems is not a good name.
<ScrollView keyboardShouldPersistTaps="handled"> | ||
<ScrollView | ||
keyboardShouldPersistTaps="handled" | ||
contentContainerStyle={themeStyles.flex1} |
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.
can you elaborate why do we need this style?
{!loginData?.validatedDate && ( | ||
<ValidateCodeActionWithoutModal | ||
hasMagicCodeBeenSent={hasMagicCodeBeenSent} | ||
isVisible={isValidateCodeActionModalVisible && !loginData.validatedDate && !!loginData} |
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.
I think we should control the visibility of this component in line 323 instead of a prop. What do you think?
|
||
{!isValidateCodeActionModalVisible && getMenuItems()} | ||
{!isValidateCodeActionModalVisible && !!loginData?.validatedDate && getMenuItems()} |
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.
Can you elaborate why do we need add an extra condition here?
useEffect( | ||
() => () => { | ||
firstRenderRef.current = true; | ||
}, | ||
[], | ||
); | ||
|
||
useEffect(() => { | ||
if (!firstRenderRef.current || !isVisible || hasMagicCodeBeenSent) { | ||
return () => { | ||
clearError(); | ||
}; | ||
} | ||
firstRenderRef.current = false; | ||
sendValidateCode(); | ||
}, [isVisible, sendValidateCode, hasMagicCodeBeenSent, clearError]); |
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.
If it's not a modal. Do we need firstRenderRef
or isVisible
anymore?
This reverts commit c19c2af.
Explanation of Change
This PR replaces
<ValidateCodeActionModal>
with<ValidateCodeActionWithoutModal>
inContactMethodDetailsPage
as it creates<ValidateCodeActionWithoutModal>
component. This component doesn't haveHeaderWithBackButton
orModal
so it can be used in any page that needs validate code form but it can uses props for<ValidateCodeActionModal>
.Fixed Issues
$ #53884
PROPOSAL:$ #53884 (comment)
Tests
Preparation
Test
Test2
Test3
Offline tests
Preparation
Test
Test2
Test3
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Preparation
Test
Test2
Test3
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
expensify-test15-2025-01-29_05.23.39.mp4
Android: mWeb Chrome
expensify-test16-2025-01-29_05.28.07.mp4
iOS: Native
2025-01-29.5.18.03.mov
iOS: mWeb Safari
2025-01-29.5.19.48.mov
MacOS: Chrome / Safari
expensify-test14-2025-01-29_05.12.06.mp4
MacOS: Desktop
2025-01-29.5.30.16.mov