Skip to content

Commit

Permalink
wrap SettlementButton with View.
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
  • Loading branch information
Krishna2323 committed Apr 22, 2024
1 parent 352d844 commit 83acd68
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/components/ButtonWithDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ButtonWithDropdownMenu<IValueType>({
}, [windowWidth, windowHeight, isMenuVisible, anchorAlignment.vertical]);

return (
<View style={[styles.w100, wrapperStyle]}>
<View style={wrapperStyle}>
{shouldAlwaysShowDropdownMenu || options.length > 1 ? (
<View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, style]}>
<Button
Expand Down
72 changes: 37 additions & 35 deletions src/pages/iou/steps/MoneyRequestAmountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,41 +387,43 @@ function MoneyRequestAmountForm(
longPressHandlerStateChanged={updateLongPressHandlerState}
/>
) : null}
{iouType === CONST.IOU.TYPE.PAY && skipConfirmation ? (
<SettlementButton
pressOnEnter
onPress={submitAndNavigateToNextPage}
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD}
currency={currency ?? CONST.CURRENCY.USD}
policyID={policyID ?? ''}
style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt3]}
buttonSize={CONST.DROPDOWN_BUTTON_SIZE.LARGE}
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,
}}
shouldShowPersonalBankAccountOption
enterKeyEventListenerPriority={1}
/>
) : (
<Button
success
// Prevent bubbling on edit amount Page to prevent double page submission when two CTA are stacked.
allowBubble={!isEditing}
pressOnEnter
medium={isExtraSmallScreenHeight}
large={!isExtraSmallScreenHeight}
style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt3]}
onPress={() => submitAndNavigateToNextPage()}
text={buttonText}
/>
)}
<View style={styles.w100}>
{iouType === CONST.IOU.TYPE.PAY && skipConfirmation ? (
<SettlementButton
pressOnEnter
onPress={submitAndNavigateToNextPage}
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD}
currency={currency ?? CONST.CURRENCY.USD}
policyID={policyID ?? ''}
style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt3]}
buttonSize={CONST.DROPDOWN_BUTTON_SIZE.LARGE}
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,
}}
shouldShowPersonalBankAccountOption
enterKeyEventListenerPriority={1}
/>
) : (
<Button
success
// Prevent bubbling on edit amount Page to prevent double page submission when two CTA are stacked.
allowBubble={!isEditing}
pressOnEnter
medium={isExtraSmallScreenHeight}
large={!isExtraSmallScreenHeight}
style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt3]}
onPress={() => submitAndNavigateToNextPage()}
text={buttonText}
/>
)}
</View>
</View>
</ScrollView>
);
Expand Down

0 comments on commit 83acd68

Please sign in to comment.