Skip to content

Commit

Permalink
fix: update modal confirmLabel logic to handle different transaction …
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
hamed-valiollahi committed Jan 16, 2024
1 parent e99930a commit 4fd21d6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions frontend/src/credit_transfers/CreditTransferViewContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,19 +517,27 @@ class CreditTransferViewContainer extends Component {
}

_modalRecommend (item) {
const isBuyOrSell = [CREDIT_TRANSFER_TYPES.buy.id, CREDIT_TRANSFER_TYPES.sell.id].indexOf(item.type.id) >= 0;

return (
<Modal
handleSubmit={(event) => {
this._changeStatus(CREDIT_TRANSFER_STATUS.recommendedForDecision)
}}
id="confirmRecommend"
key="confirmRecommend"
confirmLabel="Recommend recording transfer"
confirmLabel={
isBuyOrSell
? "Recommend recording transfer"
: "Recommend issuance"
}
cancelLabel="Cancel"
>
{[CREDIT_TRANSFER_TYPES.buy.id, CREDIT_TRANSFER_TYPES.sell.id].indexOf(item.type.id) >= 0
? 'Are you sure you want to recommend recording this transfer?'
: 'Are you sure you want to recommend issuance of compliance units for this Initiative Agreement?'}
{
isBuyOrSell
? 'Are you sure you want to recommend recording this transfer?'
: 'Are you sure you want to recommend issuance of compliance units for this Initiative Agreement?'
}
</Modal>
)
}
Expand Down

0 comments on commit 4fd21d6

Please sign in to comment.