wip: almost there
This commit is contained in:
1 parent
f07e345eb2
commit
047c810507
11 files changed
+155
-385
No files matched your search
+11
-13
@@ -11,23 +11,21 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
pub static App: FC<()> = |cx, props| {
|
||||
pub static App: FC<()> = |cx, _| {
|
||||
let state = use_state(cx, PlayerState::new);
|
||||
|
||||
let is_playing = state.is_playing();
|
||||
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
h1 {"Select an option"}
|
||||
h3 {"The radio is... {is_playing}!"}
|
||||
button {
|
||||
"Pause"
|
||||
onclick: move |_| state.modify().reduce(PlayerAction::Pause)
|
||||
}
|
||||
button {
|
||||
"Play"
|
||||
onclick: move |_| state.modify().reduce(PlayerAction::Play)
|
||||
}
|
||||
rsx!(cx, div {
|
||||
h1 {"Select an option"}
|
||||
h3 {"The radio is... {is_playing}!"}
|
||||
button {
|
||||
"Pause"
|
||||
onclick: move |_| state.modify().reduce(PlayerAction::Pause)
|
||||
}
|
||||
button {
|
||||
"Play"
|
||||
onclick: move |_| state.modify().reduce(PlayerAction::Play)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user