Something running
This commit is contained in:
parent
e03a16d13e
commit
49a9810fd8
19 changed files with 173 additions and 132 deletions
|
@ -1,5 +1,35 @@
|
|||
use leptos::prelude::*;
|
||||
use bkbh_lib::commands::*;
|
||||
use leptos::task::spawn_local;
|
||||
|
||||
use bkbh_lib::types::*;
|
||||
|
||||
#[component]
|
||||
fn SwapButton(store: Store, img_path: &'static str, pretty: &'static str) -> impl IntoView {
|
||||
view! {
|
||||
<button
|
||||
on:click=move |_| {
|
||||
spawn_local(async {
|
||||
swap("aldi", 0).await.unwrap();
|
||||
})
|
||||
}
|
||||
>
|
||||
<img
|
||||
src="assets/aldi.svg"
|
||||
class="logo"
|
||||
alt="ALDI-Süd"
|
||||
/>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
leptos::mount::mount_to_body(|| view! { <p>"Hello, world!"</p> })
|
||||
console_error_panic_hook::set_once();
|
||||
leptos::mount::mount_to_body(|| view! {
|
||||
<SwapButton
|
||||
store=Store::Aldi
|
||||
img_path=&"aldi"
|
||||
pretty=&"Aldi"
|
||||
/>
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue