-
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
refactor add payment dynamic #7847
Conversation
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.
@phivh small issue here - payment popover jumps down on resizing.
Screencast.from.22-02-22.03-12-30.AM.+03.mp4
4f33203
to
3f830ea
Compare
@rushatgabhane @deetergp updated! |
@phivh could you please post a small explaination on what fixed the resizing bug? Thanks |
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.
@phivh really minor changes
if (!this.state.transferBalanceButton) { | ||
return; | ||
} | ||
const btnPosition = getClickedElementLocation(this.state.transferBalanceButton); |
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.
rename it to buttonPosition
please
@@ -20,26 +20,41 @@ class KYCWall extends React.Component { | |||
super(props); | |||
|
|||
this.continue = this.continue.bind(this); | |||
this.setMenuPosition = this.setMenuPosition.bind(this); | |||
this.dimensionsSubscription = null; |
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.
This isn't needed, and can be removed
@@ -42,6 +42,7 @@ class BasePaymentsPage extends React.Component { | |||
formattedSelectedPaymentMethod: {}, | |||
anchorPositionTop: 0, | |||
anchorPositionLeft: 0, | |||
addPaymentMethodButton: null, |
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.
Same thing in this file. This isn't needed, and can be removed
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've explained the reason for the comment below, it is the same.
|
||
this.state = { | ||
shouldShowAddPaymentMenu: false, | ||
anchorPositionTop: 0, | ||
anchorPositionLeft: 0, | ||
transferBalanceButton: null, |
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.
Are you sure we need to put this in state? wouldn't a class variable suffice?
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.
@rushatgabhane The position of the menu belongs to position of the button that user clicking on. Thus, when use listener we need to re-assign this button when any click event happens, the possible way to re-assign any variables to the listener in this case needs to use state.
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 know this is old, but I don't understand this explanation and it seems wrong. @rushatgabhane please try to address all comments before approving 🙇♂️
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.
@marcaaron im sorry about it (and i don't understand it either)
please try to address all comments before approving
yess!
@@ -52,10 +53,32 @@ class BasePaymentsPage extends React.Component { | |||
this.deletePaymentMethod = this.deletePaymentMethod.bind(this); | |||
this.hidePasswordPrompt = this.hidePasswordPrompt.bind(this); | |||
this.navigateToTransferBalancePage = this.navigateToTransferBalancePage.bind(this); | |||
this.setMenuPosition = this.setMenuPosition.bind(this); | |||
this.dimensionsSubscription = null; |
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.
This isn't needed, and can be removed
|
||
componentWillUnmount() { | ||
this.setState({ | ||
addPaymentMethodButton: null, |
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.
Are you sure we need to put this in state? wouldn't a class variable suffice?
if (!this.state.addPaymentMethodButton) { | ||
return; | ||
} | ||
const btnPosition = getClickedElementLocation(this.state.addPaymentMethodButton); |
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.
rename to buttonPosition
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 don't have anything to add to what @rushatgabhane has requested already. Let's get those changes made and this will be good to go! 👍
@rushatgabhane @deetergp updated. |
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.
@deetergp 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.
LGTM
✋ 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 production by @chiragsalian in version: 1.1.42-6 🚀
|
Details
Fixed Issues
$ #7385
Tests
QA Steps
Tested On
Screenshots
Web
web.mp4
Mobile Web
NA
Desktop
desktop_app.mp4
iOS
NA
Android
NA