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
|
<Reception
|
||||||
acc=acc.0
|
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]
|
#[component]
|
||||||
fn SwapButton(store: Store) -> impl IntoView {
|
fn SwapButton(store: Store) -> impl IntoView {
|
||||||
view! {
|
view! {
|
||||||
|
@ -74,7 +63,7 @@ fn SwapButton(store: Store) -> impl IntoView {
|
||||||
}
|
}
|
||||||
class="column"
|
class="column"
|
||||||
>
|
>
|
||||||
<StoreLogo store=store />
|
<super::store::Logo store=store />
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +78,7 @@ fn StoreInput(store: Store) -> impl IntoView {
|
||||||
<label
|
<label
|
||||||
for=txt.clone()
|
for=txt.clone()
|
||||||
>
|
>
|
||||||
<StoreLogo store=store />
|
<super::store::Logo store=store />
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
pub mod cafe;
|
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
Add a link
Reference in a new issue