Add disabled state to button if no compiled code

This commit is contained in:
Valtteri Karesto
2021-12-13 22:27:21 +02:00
parent 4d4b96bede
commit d67613c0cf

View File

@@ -364,14 +364,28 @@ const Accounts = () => {
> >
<Text>{account.name} </Text> <Text>{account.name} </Text>
<Text css={{ color: "$mauve9" }}> <Text css={{ color: "$mauve9" }}>
{account.address} ({account.xrp}) ({account.sequence}) {account.address} (
{Dinero({
amount: Number(account?.xrp || "0"),
precision: 6,
})
.toUnit()
.toLocaleString(undefined, {
style: "currency",
currency: "XRP",
currencyDisplay: "name",
})}
)
</Text> </Text>
<Button <Button
css={{ ml: "auto" }} css={{ ml: "auto" }}
size="xs" size="xs"
uppercase uppercase
isLoading={account.isLoading} isLoading={account.isLoading}
disabled={account.isLoading} disabled={
account.isLoading ||
!snap.files.filter((file) => file.compiledWatContent).length
}
variant="secondary" variant="secondary"
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();