@kiva/kv-components 3.19.0 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.20.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.19.0...@kiva/kv-components@3.20.0) (2023-05-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * handle view loan when funded ([b6a392b](https://github.com/kiva/kv-ui-elements/commit/b6a392b0bbdcb09db37eba3d72e4b52b44eed41a))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.19.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.18.0...@kiva/kv-components@3.19.0) (2023-05-09)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.19.0",
3
+ "version": "3.20.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,5 +75,5 @@
75
75
  "optional": true
76
76
  }
77
77
  },
78
- "gitHead": "b816407effcdecfc0487c5bfb91838f9c4f25a85"
78
+ "gitHead": "9552d0a6aa251b2c2ffb74a9f748ddbf6772c13b"
79
79
  }
package/vue/KvLendCta.vue CHANGED
@@ -1,7 +1,37 @@
1
1
  <template>
2
2
  <div>
3
+ <!-- Continue to checkout button -->
3
4
  <kv-ui-button
4
- v-if="showViewLoan && !isInBasket"
5
+ v-if="isInBasket"
6
+ variant="secondary"
7
+ class="tw-inline-flex tw-flex-1"
8
+ data-testid="bp-lend-cta-checkout-button"
9
+ :to="!externalLinks ? '/basket' : undefined"
10
+ :href="externalLinks ? '/basket' : undefined"
11
+ @click.native="clickCheckout"
12
+ >
13
+ Checkout now
14
+ </kv-ui-button>
15
+
16
+ <!-- Refunded, allSharesReserved button -->
17
+ <kv-ui-button
18
+ v-else-if="showNonActionableLoanButton"
19
+ class="tw-inline-flex tw-flex-1"
20
+ >
21
+ {{ ctaButtonText }}
22
+ </kv-ui-button>
23
+
24
+ <!-- Funded / expired -->
25
+ <div
26
+ v-else-if="isFunded"
27
+ class="tw-w-full tw-text-center tw-rounded tw-p-2"
28
+ style="background: #f1f1f1;"
29
+ >
30
+ This loan was just funded! 🎉
31
+ </div>
32
+
33
+ <kv-ui-button
34
+ v-else-if="showViewLoan"
5
35
  :state="`${allSharesReserved ? 'disabled' : ''}`"
6
36
  :to="!externalLinks ? readMorePath : undefined"
7
37
  :href="externalLinks ? readMorePath : undefined"
@@ -16,6 +46,7 @@
16
46
  />
17
47
  </span>
18
48
  </kv-ui-button>
49
+
19
50
  <form
20
51
  v-else-if="useFormSubmit"
21
52
  class="tw-w-full tw-flex"
@@ -91,36 +122,6 @@
91
122
  </kv-ui-button>
92
123
  </fieldset>
93
124
  </form>
94
-
95
- <!-- Continue to checkout button -->
96
- <kv-ui-button
97
- v-if="isInBasket"
98
- variant="secondary"
99
- class="tw-inline-flex tw-flex-1"
100
- data-testid="bp-lend-cta-checkout-button"
101
- :to="!externalLinks ? '/basket' : undefined"
102
- :href="externalLinks ? '/basket' : undefined"
103
- @click.native="clickCheckout"
104
- >
105
- Checkout now
106
- </kv-ui-button>
107
-
108
- <!-- Refunded, allSharesReserved button -->
109
- <kv-ui-button
110
- v-if="showNonActionableLoanButton"
111
- class="tw-inline-flex tw-flex-1"
112
- >
113
- {{ ctaButtonText }}
114
- </kv-ui-button>
115
-
116
- <!-- Funded / expired -->
117
- <div
118
- v-if="isFunded"
119
- class="tw-w-full tw-text-center tw-rounded tw-p-2"
120
- style="background: #f1f1f1;"
121
- >
122
- This loan was just funded! 🎉
123
- </div>
124
125
  </div>
125
126
  </template>
126
127
 
@@ -143,7 +143,7 @@ export const AllSharesReserved = story({
143
143
  },
144
144
  kvTrackFunction,
145
145
  photoPath,
146
- }, false, { unreservedAmount: '0.00', fundraisingPercent: 1 });
146
+ });
147
147
 
148
148
  export const InBasket = story({
149
149
  loanId: loan.id,
@@ -214,6 +214,18 @@ export const ViewLoan = story({
214
214
  showViewLoan: true,
215
215
  });
216
216
 
217
+ export const ViewLoanFunded = story({
218
+ loanId: loan.id,
219
+ loan: {
220
+ ...loan,
221
+ unreservedAmount: '0.00',
222
+ fundraisingPercent: 1,
223
+ },
224
+ kvTrackFunction,
225
+ photoPath,
226
+ showViewLoan: true,
227
+ });
228
+
217
229
  export const LendAgain = story({
218
230
  loanId: loan.id,
219
231
  loan: {
@@ -114,3 +114,10 @@ export const ViewLoan = story({
114
114
  kvTrackFunction,
115
115
  showViewLoan: true,
116
116
  });
117
+
118
+ export const ViewLoanFunded = story({
119
+ isLoading: false,
120
+ loan: { status: 'funded' },
121
+ kvTrackFunction,
122
+ showViewLoan: true,
123
+ });