The frontend for the project formerly known as signet, now known as beignet.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

40 lignes
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>