Disable srm deposit button if srm wallet account doesn't exist
This commit is contained in:
parent
a38752d792
commit
3a3682c085
|
@ -14,7 +14,7 @@ type AccountSelectProps = {
|
||||||
onSelectAccount: (x) => any
|
onSelectAccount: (x) => any
|
||||||
getBalance?: (x) => any
|
getBalance?: (x) => any
|
||||||
hideAddress?: boolean
|
hideAddress?: boolean
|
||||||
symbols?: Array<{ [key: string]: string }>
|
symbols?: { [key: string]: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
const AccountSelect = ({
|
const AccountSelect = ({
|
||||||
|
|
|
@ -91,6 +91,7 @@ const DepositSrmModal = ({ isOpen, onClose }) => {
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<>
|
<>
|
||||||
<AccountSelect
|
<AccountSelect
|
||||||
|
symbols={{ SRM: srmMintAddress }}
|
||||||
accounts={depositAccounts}
|
accounts={depositAccounts}
|
||||||
selectedAccount={selectedAccount}
|
selectedAccount={selectedAccount}
|
||||||
onSelectAccount={setSelectedAccount}
|
onSelectAccount={setSelectedAccount}
|
||||||
|
@ -116,7 +117,11 @@ const DepositSrmModal = ({ isOpen, onClose }) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={`mt-5 flex justify-center`}>
|
<div className={`mt-5 flex justify-center`}>
|
||||||
<Button onClick={handleDeposit} className="w-full">
|
<Button
|
||||||
|
onClick={handleDeposit}
|
||||||
|
className="w-full"
|
||||||
|
disabled={!selectedAccount}
|
||||||
|
>
|
||||||
<div className={`flex items-center justify-center`}>
|
<div className={`flex items-center justify-center`}>
|
||||||
{submitting && <Loading />}
|
{submitting && <Loading />}
|
||||||
{`Deposit ${inputAmount ? inputAmount : ''} SRM
|
{`Deposit ${inputAmount ? inputAmount : ''} SRM
|
||||||
|
|
Loading…
Reference in New Issue