Skip to content

Commit

Permalink
hotfix: format available to claim
Browse files Browse the repository at this point in the history
  • Loading branch information
luistorres committed May 22, 2024
1 parent 3a384d0 commit 7bfb84f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/web-app/app/_ui/my-projects/my-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import {
} from '@/wagmi.generated';
import { useAccount } from 'wagmi';
import { formatEther, parseEther } from 'viem';
import { useCtzndRisingTideCap, useCtzndSaleCapStatus, useCtzndSaleStatus } from '@/app/_lib/hooks';
import {
useCtzndRisingTideCap,
useCtzndSaleCapStatus,
useCtzndSaleStatus,
} from '@/app/_lib/hooks';
import { useDialog } from '@/app/_providers/dialog/context';
import { number } from '../utils/intl-formaters/number';
import { usdValue } from '../utils/intl-formaters/usd-value';
Expand Down Expand Up @@ -168,22 +172,23 @@ const MyContribution = () => {
const useAvailableToClaim = () => {
const { address } = useAccount();
const capStatus = useCtzndSaleCapStatus();
const { data: uncappedAllocation } = useReadCtzndSaleUncappedAllocation({ args: [address!] });
const { data: uncappedAllocation } = useReadCtzndSaleUncappedAllocation({
args: [address!],
});
const { data: availableToClaim } = useReadCtzndSaleAllocation({
args: [address!],
query: {
enabled: !!address,
staleTime: 0,
},
});
// const { data: cap } = useCtzndRisingTideCap();

if (capStatus == "above") {
return "TBD once sale ends";
if (capStatus == 'above') {
return 'TBD once sale ends';
}

return `${formatEther(availableToClaim || 0n)} CTND`;
}
return `${number(Number(formatEther(availableToClaim || 0n)))} CTND`;
};

const MyTokens = () => {
const { address } = useAccount();
Expand Down

0 comments on commit 7bfb84f

Please sign in to comment.