The frontend for the project formerly known as signet, now known as beignet.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

40 Zeilen
1.1 KiB

  1. <template>
  2. <div class="container is-max-desktop">
  3. <section class="section is-small px-0">
  4. <template v-if="nearlyCompletedFunds.length > 0">
  5. <div class="title is-4 has-text-white-ter has-text-centered">Nearly Completed Funds</div>
  6. <div v-for="(fund, ind) in nearlyCompletedFunds" :key="ind">
  7. <RouterLink :to="`/fund/${fund.id}`">
  8. <FundLink :fund="fund" :aside="`${round(fund.raised/fund.amountAvailable*100)}%`"/>
  9. </RouterLink>
  10. </div>
  11. </template>
  12. </section>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import { getNearlyCompletedFunds } from '@/api/composed';
  18. import FundLink from '@/components/FundLink.vue';
  19. import { NearlyCompletedFund } from '@/api/types';
  20. const nearlyCompletedFunds = ref([] as NearlyCompletedFund[]);
  21. const pctThreshold = 85;
  22. const req = await getNearlyCompletedFunds(pctThreshold);
  23. if (req?.funds) {
  24. nearlyCompletedFunds.value = req?.funds;
  25. }
  26. const round = (float: number, digits = 1) => {
  27. const factor = 10 ** digits;
  28. return Math.round(float * factor) / factor;
  29. };
  30. </script>
  31. <style scoped lang="stylus">
  32. </style>