2021-04-07 14:49:37 -07:00
|
|
|
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'
|
2021-04-07 14:49:37 -07:00
|
|
|
|
|
|
|
const FeeDiscountsTable = () => {
|
|
|
|
const { totalSrm, rates } = useSrmAccount()
|
|
|
|
const connected = useMangoStore((s) => s.wallet.connected)
|
|
|
|
|
|
|
|
return (
|
2021-04-12 09:49:02 -07:00
|
|
|
<div
|
|
|
|
className={`flex flex-col items-center bg-th-bkg-1 py-6 mt-4 rounded-md`}
|
|
|
|
>
|
2021-04-07 14:49:37 -07:00
|
|
|
<div
|
2021-04-12 09:49:02 -07:00
|
|
|
className={`flex flex-col sm:flex-row justify-between m-auto text-th-fgd-4 text-base font-light text-center`}
|
2021-04-07 14:49:37 -07:00
|
|
|
>
|
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>
|
2021-04-07 14:49:37 -07:00
|
|
|
</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>
|
2021-04-07 14:49:37 -07:00
|
|
|
</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>
|
2021-04-07 14:49:37 -07:00
|
|
|
</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>
|
2021-04-07 14:49:37 -07:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default FeeDiscountsTable
|