mango-token-sale/components/StatsModal.tsx

91 lines
2.9 KiB
TypeScript
Raw Permalink Normal View History

2021-07-22 20:20:03 -07:00
import PoolCountdown from './PoolCountdown'
import useVaults from '../hooks/useVaults'
import usePool from '../hooks/usePool'
import 'twin.macro'
const StatsModal = () => {
const vaults = useVaults()
const { endIdo, endDeposits } = usePool()
// const mangoRedeemable = vaults.usdc
// ? (redeemableBalance * vaults.mango.balance) / vaults.usdc.balance
// : 0
const priceFormat = new Intl.NumberFormat('en-US', {
minimumSignificantDigits: 4,
2021-07-22 20:20:03 -07:00
maximumSignificantDigits: 4,
})
return (
<>
2021-07-26 15:19:46 -07:00
<div className="flex-1 m-3 sm:-ml-8 bg-secondary-4-dark border border-bkg-3 py-6 rounded-xl shadow-md divide-y-2 divide-white divide-opacity-5 z-0">
2021-07-24 06:19:16 -07:00
<div className="pb-4 text-center">
<p className="text-fgd-3">Sale Period Ends</p>
2021-07-24 06:19:16 -07:00
<PoolCountdown date={endDeposits} className="justify-center pt-1" />
</div>
<div className="py-4 text-center">
<p className="text-fgd-3">Grace Period Ends</p>
2021-07-24 06:19:16 -07:00
<PoolCountdown date={endIdo} className="justify-center pt-1" />
</div>
2021-07-23 16:41:38 -07:00
2021-07-24 06:19:16 -07:00
<div className="py-4 text-center">
<p className="text-fgd-3">USDC Contributed</p>
2021-07-24 06:19:16 -07:00
<div className="flex items-center justify-center pt-0.5">
<img
alt=""
width="20"
height="20"
src="/icons/usdc.svg"
className={`mr-2`}
/>
<div className="font-bold text-fgd-1 text-xl">
2021-07-26 14:08:40 -07:00
{vaults.usdcBalance}
2021-07-22 20:20:03 -07:00
</div>
</div>
2021-07-24 06:19:16 -07:00
</div>
2021-07-26 14:08:40 -07:00
2021-07-24 06:19:16 -07:00
<div className="py-4 text-center">
<p className="text-fgd-3">Estimated Token Price</p>
2021-07-24 06:19:16 -07:00
<div className="flex items-center justify-center pt-0.5">
2021-07-26 13:00:05 -07:00
<img
alt=""
width="20"
height="20"
src="/icons/usdc.svg"
className={`mr-2`}
/>
<div className="font-bold text-fgd-1 text-xl">
2021-07-26 14:08:40 -07:00
{priceFormat.format(vaults.estimatedPrice)}
2021-07-22 20:20:03 -07:00
</div>
</div>
2021-07-24 06:19:16 -07:00
</div>
2021-07-26 14:08:40 -07:00
2021-07-24 06:19:16 -07:00
<div className="pt-4 text-center">
<p className="text-fgd-3">MNGO For Sale</p>
2021-07-24 06:19:16 -07:00
<div className="flex items-center justify-center pt-0.5">
<img className="h-5 mr-2 w-auto" src="/logo.svg" alt="mango" />
<div className="font-bold text-fgd-1 text-xl">
2021-07-24 06:19:16 -07:00
{vaults.mangoBalance}
2021-07-22 20:20:03 -07:00
</div>
2021-07-28 00:39:59 -07:00
</div>
2021-07-23 16:41:38 -07:00
2021-07-28 00:39:59 -07:00
{/* <p>
2021-07-23 16:41:38 -07:00
Start: {startIdo?.fromNow()} ({startIdo?.format()})
</p>
<p>
End Deposits: {endDeposits?.fromNow()} ({endDeposits?.format()})
</p>
<p>
End Withdraws: {endIdo?.fromNow()} ({endIdo?.format()})
</p>
<p>Current USDC in Pool: {vaults.usdc?.balance || 'N/A'}</p>
<p>Locked MNGO in Pool: {vaults.mango?.balance || 'N/A'}</p> */}
2021-07-28 00:39:59 -07:00
</div>
2021-07-23 16:41:38 -07:00
</div>
2021-07-22 20:20:03 -07:00
</>
)
}
export default StatsModal