From 6d7135620106ced6eafc25ad81cf15fd79301e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Ag=C3=BCero?= <54730752+EmmanuelAR@users.noreply.github.com> Date: Sat, 21 Dec 2024 16:11:41 -0600 Subject: [PATCH] allow to donate once the goal reach, and validate progress bar --- app/utils/index.ts | 3 +++ components/modules/Fund/Fund.tsx | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/utils/index.ts b/app/utils/index.ts index 7b3a813..bec726c 100644 --- a/app/utils/index.ts +++ b/app/utils/index.ts @@ -7,5 +7,8 @@ export default function hex2ascii(hexx: string) { } export function calculatePorcentage(qty: number, goal: number): number { + if( qty >= goal ){ + return 100; + } return (Number(qty) / Number(goal)) * 100; } \ No newline at end of file diff --git a/components/modules/Fund/Fund.tsx b/components/modules/Fund/Fund.tsx index 3552cce..5107443 100644 --- a/components/modules/Fund/Fund.tsx +++ b/components/modules/Fund/Fund.tsx @@ -108,7 +108,7 @@ const Fund = () => { voted={fund.voted} /> )} - {Number(fund.state) === 2 && ( + {Number(fund.state) === 2 || Number(fund.state) === 3 && !isOwner && ( <> { getDetails={getDetails} /> )} - {Number(fund.state) === 3 && !isOwner && ( + {/* {Number(fund.state) === 3 && !isOwner && (

The goal has been reached and funds are ready to be withdrawn by the owner.

- )} + )} */} {Number(fund.state) === 4 &&

Fund was already withdrawn.

} )}