Skip to content

Commit

Permalink
Merge pull request #11 from web3wagers/feat/10
Browse files Browse the repository at this point in the history
Allow to donate once the goal reach, and validate progress bar
  • Loading branch information
adrianvrj authored Dec 21, 2024
2 parents 04405d0 + 6d71356 commit 4e229bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions components/modules/Fund/Fund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const Fund = () => {
voted={fund.voted}
/>
)}
{Number(fund.state) === 2 && (
{Number(fund.state) === 2 || Number(fund.state) === 3 && !isOwner && (
<>
<FundDonate
currentBalance={fund.currentBalance}
Expand All @@ -128,11 +128,11 @@ const Fund = () => {
getDetails={getDetails}
/>
)}
{Number(fund.state) === 3 && !isOwner && (
{/* {Number(fund.state) === 3 && !isOwner && (
<p className="mt-10 self-center text-xl text-gray-500">
The goal has been reached and funds are ready to be withdrawn by the owner.
</p>
)}
)} */}
{Number(fund.state) === 4 && <p>Fund was already withdrawn.</p>}
</section>
)}
Expand Down

0 comments on commit 4e229bd

Please sign in to comment.