mango-token-sale/components/PoolInfoCards.tsx

79 lines
2.1 KiB
TypeScript
Raw Permalink Normal View History

2021-07-07 04:16:54 -07:00
import usePool from '../hooks/usePool'
import useVaults from '../hooks/useVaults'
import PoolCountdown from './PoolCountdown'
const Card = (props: any) => {
return (
<div
2021-07-22 23:39:47 -07:00
className="flex-1 m-2 p-5 border border-bkg-3 rounded-xl h-auto w-auto z-10 shadow-md"
2021-07-07 04:16:54 -07:00
style={{ backgroundColor: 'rgba(44, 41, 66, 1)' }}
>
2021-07-22 23:39:47 -07:00
<p className="pb-2 text-white text-opacity-50 text-md">{props.title}</p>
2021-07-07 04:16:54 -07:00
{props.children}
</div>
)
}
const PoolInfoCards = () => {
const { endIdo, endDeposits } = usePool()
const vaults = useVaults()
//const numberFormat = new Intl.NumberFormat('en-US', {
// maximumFractionDigits: 10,
//})
2021-07-16 09:07:37 -07:00
2021-07-07 04:16:54 -07:00
return (
<div className="max-w-7xl flex flex-wrap mx-auto px-6 mb-16 z-10">
<Card title="Sale Period Ends">
2021-07-24 06:19:16 -07:00
<PoolCountdown date={endDeposits} />
</Card>
2021-07-07 04:16:54 -07:00
<Card title="Grace Period Ends">
2021-07-24 06:19:16 -07:00
<PoolCountdown date={endIdo} />
</Card>
<Card title="USDC Contributed">
2021-07-07 04:16:54 -07:00
<div className="flex">
<img
alt="USDC"
width="25"
height="25"
2021-07-07 04:16:54 -07:00
src="/icons/usdc.svg"
className={`mr-4`}
2021-07-07 04:16:54 -07:00
/>{' '}
<div className="font-bold text-fgd-1 text-xl">
2021-07-07 04:16:54 -07:00
{vaults.usdcBalance}
</div>
</div>
</Card>
<Card title="MNGO For Sale">
2021-07-24 06:19:16 -07:00
<div className="flex">
<img className="h-7 mr-2 w-auto" src="/logo.svg" alt="MNGO" />
<div className="font-bold text-fgd-1 text-xl">
{vaults.mangoBalance}
</div>
2021-07-24 06:19:16 -07:00
</div>
</Card>
{/*
2021-07-24 06:19:16 -07:00
<Card title="Estimated token price">
<div className="flex">
<img
alt="USDC"
width="25"
height="25"
src="/icons/usdc.svg"
className={`mr-2`}
/>{' '}
<div className="font-bold text-fgd-1 text-xl">
{vaults.estimatedPrice
? numberFormat.format(vaults.estimatedPrice)
: 'N/A'}
2021-07-07 04:16:54 -07:00
</div>
2021-07-24 06:19:16 -07:00
</div>
</Card>
*/}
2021-07-07 04:16:54 -07:00
</div>
)
}
export default PoolInfoCards