-
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
migrating MoneyRequestAmountPage to functional component #21005
migrating MoneyRequestAmountPage to functional component #21005
Conversation
@thesahindia 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] |
Not sure why melvin didn't request a review from @Julesssss 🤔 The changes looks good, I will try to test it in the morning. |
@BhuvaneshPatil, you missed this item. You need to check off all the items, otherwise the test will fail. |
@thesahindia , Updated the checklist |
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.
Let's add a display name for this component. Also please resolve the conflicts.
…grate-MoneyRequestAmountPage
Friendly bump @Julesssss @thesahindia |
@BhuvaneshPatil, the amount changes to 0 when I choose a different currency Screen.Recording.2023-06-23.at.1.57.25.AM.mov |
Thank you for pointing out @thesahindia . That occurred while resolving merge conflicts |
Taking this one as C+ (reviewer) |
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.
Round 1 (didn't review all code yet* - will re-review once the below comments are addressed). This page was refactored recently and there is a lot of outdated code.
Tip: Refer to MoneyRequestConfirmPage
.
…78-migrate-MoneyRequestAmountPage
@BhuvaneshPatil Let me know when this is ready for re-review |
Hi @s77rt , I am working on the useEffect refactoring, will let you know once done |
@s77rt I have pushed the changes, I think there are still more improvements need to be done for |
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.
Let's try prioritise the case stated in updateAmount
.
Also found a bug, can't modify amount:
- Start money request
- Type any amount
- Press Next
- Select participants
- Press Next
- Click on Amount
You should be on send/new/amount
but instead you are redirected to send/new
(starting the request from the beginning)
…78-migrate-MoneyRequestAmountPage
@BhuvaneshPatil @s77rt Can we please prioritize getting this one over the finish line? |
@BhuvaneshPatil I see the commits now. Seems to cover only two concerns: the |
Bug that you have mentioned is resolved. PS - It was happening because I forgot to add |
…78-migrate-MoneyRequestAmountPage
@s77rt , updated the code |
@BhuvaneshPatil Thanks! Can you please resolve the conflicts? |
Yes @s77rt . Working on them. There we have new method - I have wrapped it in the useCallback, and added to dependency array. Tested it - Working as expected. |
I don't see the need of useCallback here. Just wrap the function in it's own useEffect |
@s77rt Sorry, but I am afraid that I don't understand what you are implying here Do you meant to say that, create a new useEffect and have this function inside it -
|
@BhuvaneshPatil Yes, that should do it; but |
@s77rt I have updated the code for dismiss modal |
@BhuvaneshPatil Awesome! Code looking good. While testing on iOS I noticed some cursor jump behaviour, I think this bug exists in main but the jump behaviour seems to happen more often. Can you please confirm from your side if this is a regression or not? |
Reviewer Checklist
Screenshots/Videos |
@mountiny We are probably good to merge, just need a confirmation from @BhuvaneshPatil about the iOS behaviour, it's seems to have a buggy cursor but I'm getting this on main too. So I guess we can move on with that |
@s77rt , I checked on master and new implementation. The jumpy behavior is at both places |
@BhuvaneshPatil Thanks for the confirmation. |
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.
LGTM! 🚀
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.
One minor comment otherwise looking good.
All yours @Julesssss!
Just waiting for a lint PR fix to avoid errors once merged. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.39-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.39-11 🚀
|
start: selectedAmountAsStringForState.length, | ||
end: selectedAmountAsStringForState.length, | ||
}); | ||
}, [props.iou.amount, props.iou.currency]); |
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.
Hi, this PR caused a regression/bug - Currency changes after refresh although URL has currency params
#23436
more details here - #23436 (comment)
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.
Interesting! Previously we used the componentDidUpdate
method which only occurs after an update while the useEffect
is triggered also on the initial render (ignoring dependencies).
Details>
Refactoring
MoneyRequestAmountPage
to a functional componentFixed Issues
$ #16278
PROPOSAL: #16278 (comment)
Tests
MoneyRequestAmountPage
it's opened when we create a Split Bill or Request Money or Send MoneyOffline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Google.Desktop.web.-.Made.with.Clipchamp.mp4
Mobile Web - Chrome
Mobile.-.Web.mp4
Mobile Web - Safari
Mobile.web.safari.mp4
Desktop
desktop.-.Made.with.Clipchamp.mp4
iOS
ios.-.Made.with.Clipchamp.mp4
Android
Android.-.Made.with.Clipchamp.mp4