-
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
[CP Staging] Fix send button popover position #29361
Changes from all commits
c2283d9
9564f49
dbe041c
b7fc294
aaeef6f
a2bdeea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,7 +506,11 @@ function MoneyRequestConfirmationList(props) { | |
policyID={props.policyID} | ||
shouldShowPaymentOptions | ||
buttonSize={CONST.DROPDOWN_BUTTON_SIZE.LARGE} | ||
anchorAlignment={{ | ||
kycWallAnchorAlignment={{ | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, | ||
}} | ||
paymentMethodDropdownAnchorAlignment={{ | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, | ||
}} | ||
Comment on lines
+509
to
516
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this button is at bottom of page so vertical anchor alignment is BOTTOM (popover above button). the horizontal anchor alignment for second one is RIGHT because caret icon is at right |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,14 @@ const propTypes = { | |
/** Whether we should show a loading state for the main button */ | ||
isLoading: PropTypes.bool, | ||
|
||
/** The anchor alignment of the popover menu */ | ||
anchorAlignment: PropTypes.shape({ | ||
/** The anchor alignment of the popover menu for payment method dropdown */ | ||
paymentMethodDropdownAnchorAlignment: PropTypes.shape({ | ||
horizontal: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL)), | ||
vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), | ||
}), | ||
|
||
/** The anchor alignment of the popover menu for KYC wall popover */ | ||
kycWallAnchorAlignment: PropTypes.shape({ | ||
horizontal: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL)), | ||
vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), | ||
}), | ||
|
@@ -96,16 +102,21 @@ const defaultProps = { | |
policyID: '', | ||
formattedAmount: '', | ||
buttonSize: CONST.DROPDOWN_BUTTON_SIZE.MEDIUM, | ||
anchorAlignment: { | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
kycWallAnchorAlignment: { | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, // button is at left, so horizontal anchor is at LEFT | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, // we assume that popover menu opens below the button, anchor is at TOP | ||
}, | ||
paymentMethodDropdownAnchorAlignment: { | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, // caret for dropdown is at right, so horizontal anchor is at RIGHT | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, // we assume that popover menu opens below the button, anchor is at TOP | ||
}, | ||
}; | ||
|
||
function SettlementButton({ | ||
addDebitCardRoute, | ||
addBankAccountRoute, | ||
anchorAlignment, | ||
kycWallAnchorAlignment, | ||
paymentMethodDropdownAnchorAlignment, | ||
Comment on lines
+118
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aimane-chnaif if you have any better prop name suggestions, please let me know There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fine with those namings |
||
betas, | ||
buttonSize, | ||
chatReportID, | ||
|
@@ -210,7 +221,7 @@ function SettlementButton({ | |
source={CONST.KYC_WALL_SOURCE.REPORT} | ||
chatReportID={chatReportID} | ||
iouReport={iouReport} | ||
anchorAlignment={anchorAlignment} | ||
anchorAlignment={kycWallAnchorAlignment} | ||
> | ||
{(triggerKYCFlow, buttonRef) => ( | ||
<ButtonWithDropdownMenu | ||
|
@@ -222,7 +233,7 @@ function SettlementButton({ | |
options={paymentButtonOptions} | ||
style={style} | ||
buttonSize={buttonSize} | ||
anchorAlignment={anchorAlignment} | ||
anchorAlignment={paymentMethodDropdownAnchorAlignment} | ||
/> | ||
)} | ||
</KYCWall> | ||
|
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.
don't need to pass props unnecessarily as the default props are enough here