do not show account details if there are no accounts
This commit is contained in:
parent
9e37ddc955
commit
36e35768c1
@ -40,9 +40,13 @@ impl Component for Accounts {
|
||||
fn view(&self, ctx: &Context<Self>) -> Html {
|
||||
html! {
|
||||
<>
|
||||
if ctx.props().account_nrs.is_empty() {
|
||||
<h2>{"No accounts"}</h2>
|
||||
} else {
|
||||
<ul class={classes!("accounts")}>
|
||||
{ for ctx.props().account_nrs.iter().map(|e| self.account_entry(e, &ctx.props().selected_nr, ctx)) }
|
||||
</ul>
|
||||
}
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,9 @@ impl Component for Main {
|
||||
</h1>
|
||||
<div class={classes!("inner-content")}>
|
||||
<Accounts account_nrs={self.account_nrs.clone()} selected_nr={self.selected_nr.clone()} />
|
||||
if !self.account_nrs.is_empty() {
|
||||
<Account balance={self.selected_balance} owner={self.selected_owner.clone()} nr={self.selected_nr.clone()} account_nrs={self.account_nrs.clone()} />
|
||||
}
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user