only enable transfer button if a valid transfer account is selected
This commit is contained in:
parent
7413f09170
commit
4130d36472
@ -36,6 +36,10 @@ impl Account {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_transfer_account_valid(&self) -> bool {
|
||||
self.selected_transfer_account().is_some()
|
||||
}
|
||||
|
||||
fn is_amount_valid(&self) -> bool {
|
||||
self.amount() > 0_f64
|
||||
}
|
||||
@ -157,7 +161,7 @@ impl Component for Account {
|
||||
|
||||
<button onclick={on_deposit} class={classes!("account__button")} disabled={!self.amount_valid}>{"deposit"}</button>
|
||||
<button onclick={on_withdraw} class={classes!("account__button")} disabled={!self.amount_valid}>{"withdraw"}</button>
|
||||
<button onclick={on_transfer} class={classes!("account__button")} disabled={!self.amount_valid}>{"transfer"}</button>
|
||||
<button onclick={on_transfer} class={classes!("account__button")} disabled={!self.amount_valid || !self.is_transfer_account_valid()}>{"transfer"}</button>
|
||||
</fieldset>
|
||||
</section>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user