Skip to content

Commit

Permalink
Add pressOnEnter to the SettlementButton
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Oct 11, 2023
1 parent 9b2f6dd commit ca067bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ function MoneyRequestConfirmationList(props) {

const button = shouldShowSettlementButton ? (
<SettlementButton
pressOnEnter
isDisabled={shouldDisableButton}
onPress={confirm}
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
Expand Down
6 changes: 6 additions & 0 deletions src/components/SettlementButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const propTypes = {
/** Callback to execute when this button is pressed. Receives a single payment type argument. */
onPress: PropTypes.func.isRequired,

/** Call the onPress function on main button when Enter key is pressed */
pressOnEnter: PropTypes.bool,

/** Settlement currency type */
currency: PropTypes.string,

Expand Down Expand Up @@ -75,6 +78,7 @@ const propTypes = {
const defaultProps = {
isLoading: false,
isDisabled: false,
pressOnEnter: false,
addBankAccountRoute: '',
addDebitCardRoute: '',
currency: CONST.CURRENCY.USD,
Expand Down Expand Up @@ -111,6 +115,7 @@ function SettlementButton({
formattedAmount,
nvp_lastPaymentMethod,
onPress,
pressOnEnter,
policyID,
shouldShowPaymentOptions,
style,
Expand Down Expand Up @@ -209,6 +214,7 @@ function SettlementButton({
isDisabled={isDisabled}
isLoading={isLoading}
onPress={(event, iouPaymentType) => selectPaymentType(event, iouPaymentType, triggerKYCFlow)}
pressOnEnter={pressOnEnter}
options={paymentButtonOptions}
style={style}
buttonSize={buttonSize}
Expand Down

0 comments on commit ca067bc

Please sign in to comment.