Refactor
This commit is contained in:
parent
7cc7f03e5c
commit
eda34db508
4 changed files with 27 additions and 14 deletions
8
src/leptos/angel.rs
Normal file
8
src/leptos/angel.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use leptos::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn Angel() -> impl IntoView {
|
||||
view! {
|
||||
<p>Hi</p>
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ pub fn Cafe() -> impl IntoView {
|
|||
<Reception
|
||||
acc=acc.0
|
||||
/>
|
||||
<InvForm />
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,18 +52,6 @@ fn Reception(acc: ReadSignal<Account>) -> impl IntoView {
|
|||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn StoreLogo(store: Store) -> impl IntoView {
|
||||
view! {
|
||||
<img
|
||||
src=format!("assets/{}.svg", Into::<String>::into(&store))
|
||||
class="logo"
|
||||
// FIXME: Implement fmt::Display for Store
|
||||
alt=format!("{:?}", store)
|
||||
/>
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn SwapButton(store: Store) -> impl IntoView {
|
||||
view! {
|
||||
|
@ -74,7 +63,7 @@ fn SwapButton(store: Store) -> impl IntoView {
|
|||
}
|
||||
class="column"
|
||||
>
|
||||
<StoreLogo store=store />
|
||||
<super::store::Logo store=store />
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +78,7 @@ fn StoreInput(store: Store) -> impl IntoView {
|
|||
<label
|
||||
for=txt.clone()
|
||||
>
|
||||
<StoreLogo store=store />
|
||||
<super::store::Logo store=store />
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
pub mod cafe;
|
||||
pub mod angel;
|
||||
pub mod store;
|
||||
|
|
14
src/leptos/store.rs
Normal file
14
src/leptos/store.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use leptos::prelude::*;
|
||||
use crate::types::*;
|
||||
|
||||
#[component]
|
||||
pub fn Logo(store: Store) -> impl IntoView {
|
||||
view! {
|
||||
<img
|
||||
src=format!("assets/{}.svg", Into::<String>::into(&store))
|
||||
class="logo"
|
||||
// FIXME: Implement fmt::Display for Store
|
||||
alt=format!("{:?}", store)
|
||||
/>
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue