Skip to content

Commit

Permalink
fix: show the checkout now button and emit to show basket on corporat…
Browse files Browse the repository at this point in the history
…e landing loan cards
  • Loading branch information
mcstover committed Feb 3, 2024
1 parent 915cc1b commit d4b0819
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/components/Contentful/CampaignLoanWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
@show-loan-details="componentProps.showLoanDetails"
@reset-loan-filters="componentProps.handleResetLoanFilters"
@remove-loan-from-basket="componentProps.removeLoanFromBasket"
@show-basket="componentProps.showBasket"
/>

<campaign-loan-grid-display
Expand All @@ -65,6 +66,7 @@
@show-loan-details="componentProps.showLoanDetails"
@reset-loan-filters="componentProps.handleResetLoanFilters"
@remove-loan-from-basket="componentProps.removeLoanFromBasket"
@show-basket="componentProps.showBasket"
/>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/CorporateCampaign/CampaignLoanGridDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
:loan-id="loan"
:show-action-button="true"
:custom-loan-details="true"
:custom-checkout-button-text="getCheckoutBtnText(loan)"
:checkout-route="checkoutRoute"
:use-emitted-add-to-basket="true"
@show-loan-details="showLoanDetails(loans[index])"
@add-to-basket="addToBasket"
@custom-checkout-button-action="removeLoanFromBasket(loan)"
@custom-checkout-button-action="$emit('show-basket')"
/>
</div>
<kv-pagination
Expand Down Expand Up @@ -228,6 +227,9 @@ export default {
removeLoanFromBasket(loanId) {
this.$emit('remove-loan-from-basket', loanId);
},
showBasket() {
this.$emit('show-basket');
},
showLoanDetails(loan) {
this.$emit('show-loan-details', loan);
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/CorporateCampaign/CampaignLoanRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@
:show-action-button="true"
:checkout-route="checkoutRoute"
:custom-loan-details="true"
:custom-checkout-button-text="getCheckoutBtnText(loan)"
:use-emitted-add-to-basket="true"
@show-loan-details="showLoanDetails(loans[index])"
@add-to-basket="addToBasket"
@custom-checkout-button-action="removeLoanFromBasket(loan)"
@custom-checkout-button-action="$emit('show-basket')"
/>
</div>
</template>
Expand Down Expand Up @@ -221,6 +220,7 @@ export default {
}
},
methods: {
// Currently Unused
getCheckoutBtnText(loan) {
const amount = this.getAmountLended(loan);
if (amount > 0) {
Expand All @@ -242,6 +242,9 @@ export default {
removeLoanFromBasket(loanId) {
this.$emit('remove-loan-from-basket', loanId);
},
showBasket() {
this.$emit('show-basket');
},
fetchLoans() {
if (this.isVisible) {
this.loadingLoans = true;
Expand Down

0 comments on commit d4b0819

Please sign in to comment.