@kiva/kv-components 3.79.0 → 3.80.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,22 @@
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.80.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.79.0...@kiva/kv-components@3.80.0) (2024-05-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add showContributors condition ([2fe0be3](https://github.com/kiva/kv-ui-elements/commit/2fe0be34ea8cb18fdce37a0eba979d089a850426))
12
+
13
+
14
+ ### Features
15
+
16
+ * show contributors section of loan card ([e65e80f](https://github.com/kiva/kv-ui-elements/commit/e65e80f1862c93e45b9f3a05a3a01d3585b4fc7c))
17
+
18
+
19
+
20
+
21
+
6
22
  # [3.79.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.78.2...@kiva/kv-components@3.79.0) (2024-05-21)
7
23
 
8
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.79.0",
3
+ "version": "3.80.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": "dcf6cda7c9e7fc9437c2f5e0a607cebeb503eea2"
78
+ "gitHead": "3dbb81161c861155a392916f6bf297caea902e86"
79
79
  }
@@ -233,6 +233,16 @@
233
233
  @remove-from-basket="$emit('remove-from-basket', $event)"
234
234
  />
235
235
  </div>
236
+
237
+ <div
238
+ v-if="showContributors && lendersNumber && amountLent"
239
+ class="tw-text-center tw-w-full tw-mt-1 tw-font-medium "
240
+ >
241
+ <p>
242
+ {{ lendersNumber }} people contributed {{ amountLent }}
243
+ </p>
244
+ </div>
245
+
236
246
  <div
237
247
  v-if="combinedActivities.length > 0"
238
248
  class="tw-pt-1.5"
@@ -263,6 +273,7 @@
263
273
  </template>
264
274
 
265
275
  <script>
276
+ import numeral from 'numeral';
266
277
  import { loanCardComputedProperties, loanCardMethods } from '../utils/loanCard';
267
278
 
268
279
  import KvLoanUse from './KvLoanUse.vue';
@@ -413,6 +424,10 @@ export default {
413
424
  type: String,
414
425
  default: 'Checkout now',
415
426
  },
427
+ showContributors: {
428
+ type: Boolean,
429
+ default: false,
430
+ },
416
431
  },
417
432
  setup(props) {
418
433
  const {
@@ -493,6 +508,13 @@ export default {
493
508
  { width: 335, viewSize: 375 },
494
509
  ];
495
510
  },
511
+ lendersNumber() {
512
+ return this.loan?.lenders?.totalCount ?? 0;
513
+ },
514
+ amountLent() {
515
+ const amount = this.loan?.loanFundraisingInfo?.fundedAmount ?? 0;
516
+ return numeral(parseFloat(amount)).format('$0,0');
517
+ },
496
518
  },
497
519
  };
498
520
  </script>
@@ -429,3 +429,20 @@ export const RemoveButton = story({
429
429
  secondaryButtonText: 'Remove Loan',
430
430
  secondaryButtonHandler: () => {},
431
431
  });
432
+
433
+ export const ContributorsAndAmount = story({
434
+ loanId: loan.id,
435
+ loan: {
436
+ ...loan,
437
+ loanFundraisingInfo: {
438
+ fundedAmount: '950.00',
439
+ reservedAmount: '0.00',
440
+ isExpiringSoon: false,
441
+ },
442
+ lenders: {
443
+ totalCount: 7,
444
+ },
445
+ },
446
+ kvTrackFunction,
447
+ photoPath,
448
+ });