Fix issues with modals (#12)
* Correctly visualize that USDC could not be found in users wallet * fix contribution modal message * solve some rounding issues
This commit is contained in:
parent
52b0b62e1c
commit
4386d5ea86
|
@ -153,6 +153,8 @@ const ContributionModal = () => {
|
|||
}
|
||||
}, [submitting])
|
||||
|
||||
const hasUSDC = usdcBalance > 0 || redeemableBalance > 0
|
||||
|
||||
const toLateToDeposit =
|
||||
endDeposits?.isBefore() && endIdo.isAfter() && !largestAccounts.redeemable
|
||||
|
||||
|
@ -224,7 +226,9 @@ const ContributionModal = () => {
|
|||
<div className="flex items-center text-xs text-fgd-4">
|
||||
<a
|
||||
onClick={handleRefresh}
|
||||
className={refreshing ? 'animate-spin' : 'hover:cursor-pointer'}
|
||||
className={
|
||||
refreshing ? 'animate-spin' : 'hover:cursor-pointer'
|
||||
}
|
||||
>
|
||||
<RefreshIcon
|
||||
className={`w-4 h-4`}
|
||||
|
@ -317,8 +321,10 @@ const ContributionModal = () => {
|
|||
>
|
||||
<div className={`flex items-center justify-center`}>
|
||||
{dontAddMore
|
||||
? 'Sorry you can’t add anymore 🥲'
|
||||
: 'Set Contribution'}
|
||||
? "Sorry you can't add anymore 🥲"
|
||||
: hasUSDC || !connected
|
||||
? 'Set Contribution'
|
||||
: 'Loading USDC balance 💦'}
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -12,6 +12,7 @@ const StatsModal = () => {
|
|||
// : 0
|
||||
|
||||
const priceFormat = new Intl.NumberFormat('en-US', {
|
||||
minimumSignificantDigits: 4,
|
||||
maximumSignificantDigits: 4,
|
||||
})
|
||||
|
||||
|
|
|
@ -31,6 +31,6 @@ export function calculateNativeAmountUnsafe(
|
|||
amount: number
|
||||
): BN {
|
||||
const mint = mints[pk.toBase58()]
|
||||
const nativeAmount = amount * Math.pow(10, mint.decimals)
|
||||
const nativeAmount = Math.round(amount * Math.pow(10, mint.decimals))
|
||||
return new BN(nativeAmount.toString())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue