fix alpha modal issue

This commit is contained in:
Tyler Shipe 2021-08-30 16:40:32 -04:00
parent 2c50835a21
commit c6e09c1ba1
4 changed files with 34 additions and 26 deletions

View File

@ -97,27 +97,29 @@ export default function AccountInfo() {
return (
<FloatingElement showConnect>
<div className={!connected ? 'filter blur-sm' : undefined}>
<Tooltip
content={
mangoAccount ? (
<div>
Init Health:{' '}
{mangoAccount
.getHealth(mangoGroup, mangoCache, 'Init')
.toString()}
<br />
Maint Health:{' '}
{mangoAccount
.getHealth(mangoGroup, mangoCache, 'Maint')
.toString()}
</div>
) : (
''
)
}
>
<ElementTitle>Account</ElementTitle>
</Tooltip>
<ElementTitle>
<Tooltip
content={
mangoAccount ? (
<div>
Init Health:{' '}
{mangoAccount
.getHealth(mangoGroup, mangoCache, 'Init')
.toFixed(4)}
<br />
Maint Health:{' '}
{mangoAccount
.getHealth(mangoGroup, mangoCache, 'Maint')
.toFixed(4)}
</div>
) : (
''
)
}
>
Account
</Tooltip>
</ElementTitle>
<div>
<div>
<div className="flex justify-between pb-3">

View File

@ -240,10 +240,14 @@ const DepositModal: FunctionComponent<DepositModalProps> = ({
</div>
</div>
<div className={`mt-5 flex justify-center`}>
<Button onClick={handleDeposit} className="w-full">
<Button
onClick={handleDeposit}
className="w-full"
disabled={submitting}
>
<div className={`flex items-center justify-center`}>
{submitting && <Loading className="-ml-1 mr-3" />}
Confirm
Deposit
</div>
</Button>
</div>

View File

@ -581,7 +581,9 @@ const WithdrawModal: FunctionComponent<WithdrawModalProps> = ({
<Button
onClick={handleWithdraw}
disabled={
Number(inputAmount) <= 0 || simulation.initHealthRatio < 0
Number(inputAmount) <= 0 ||
simulation.initHealthRatio < 0 ||
submitting
}
className="w-full"
>

View File

@ -1,12 +1,12 @@
import TopBar from '../components/TopBar'
import TradePageGrid from '../components/TradePageGrid'
import MarketSelect from '../components/MarketSelect'
import AlphaModal from '../components/AlphaModal'
import AlphaModal, { ALPHA_MODAL_KEY } from '../components/AlphaModal'
import MarketHeader from '../components/MarketHeader'
import useLocalStorageState from '../hooks/useLocalStorageState'
const Index = () => {
const [alphaAccepted] = useLocalStorageState('mangoAlphaAccepted-2.0', false)
const [alphaAccepted] = useLocalStorageState(ALPHA_MODAL_KEY, false)
return (
<div className={`bg-th-bkg-1 text-th-fgd-1 transition-all `}>