Disable srm deposit button if srm wallet account doesn't exist

This commit is contained in:
Tyler Shipe 2021-05-05 12:43:13 -04:00
parent a38752d792
commit 3a3682c085
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ type AccountSelectProps = {
onSelectAccount: (x) => any
getBalance?: (x) => any
hideAddress?: boolean
symbols?: Array<{ [key: string]: string }>
symbols?: { [key: string]: string }
}
const AccountSelect = ({

View File

@ -91,6 +91,7 @@ const DepositSrmModal = ({ isOpen, onClose }) => {
</Modal.Header>
<>
<AccountSelect
symbols={{ SRM: srmMintAddress }}
accounts={depositAccounts}
selectedAccount={selectedAccount}
onSelectAccount={setSelectedAccount}
@ -116,7 +117,11 @@ const DepositSrmModal = ({ isOpen, onClose }) => {
/>
</div>
<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`}>
{submitting && <Loading />}
{`Deposit ${inputAmount ? inputAmount : ''} SRM