mango-ui-v2/components/FeeDiscountsTable.tsx

56 lines
1.7 KiB
TypeScript
Raw Normal View History

import { percentFormat } from '../utils/index'
import useSrmAccount from '../hooks/useSrmAccount'
import useMangoStore from '../stores/useMangoStore'
2021-04-10 12:21:02 -07:00
import Button from './Button'
const FeeDiscountsTable = () => {
const { totalSrm, rates } = useSrmAccount()
const connected = useMangoStore((s) => s.wallet.connected)
return (
<div
className={`flex flex-col items-center bg-th-bkg-1 py-6 mt-4 rounded-md`}
>
<div
className={`flex flex-col sm:flex-row justify-between m-auto text-th-fgd-4 text-base font-light text-center`}
>
2021-04-12 15:19:20 -07:00
<div className="px-4">
2021-04-12 06:32:01 -07:00
<div>Total SRM in Mango</div>
2021-04-12 15:19:20 -07:00
<div className="text-th-fgd-1 text-lg font-semibold">
2021-04-12 06:32:01 -07:00
{totalSrm.toFixed(0)}
</div>
</div>
2021-04-12 15:19:20 -07:00
<div className="px-4 mt-4 sm:mt-0">
2021-04-12 06:32:01 -07:00
<div>Maker Fee</div>
2021-04-12 15:19:20 -07:00
<div className="text-th-fgd-1 text-lg font-semibold">
2021-04-12 06:32:01 -07:00
{rates ? percentFormat.format(rates.maker) : null}
</div>
</div>
2021-04-12 15:19:20 -07:00
<div className="px-4 mt-4 sm:mt-0">
2021-04-12 06:32:01 -07:00
<div>Taker Fee</div>
2021-04-12 15:19:20 -07:00
<div className="text-th-fgd-1 text-lg font-semibold">
2021-04-12 06:32:01 -07:00
{rates ? percentFormat.format(rates.taker) : null}
</div>
</div>
</div>
2021-04-12 15:19:20 -07:00
<div className="mt-6">
2021-04-12 06:32:01 -07:00
{connected ? (
2021-04-12 15:19:20 -07:00
<div className="bg-th-bkg-2 p-6">
<div className="text-th-fgd-4 text-center">
Your contributed SRM: 0
</div>
<div className="flex space-x-4 mt-8">
2021-04-12 06:32:01 -07:00
<Button>Deposit</Button>
<Button>Withdraw</Button>
</div>
</div>
) : (
<Button disabled>Connect wallet to deposit SRM</Button>
)}
</div>
</div>
)
}
export default FeeDiscountsTable