mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
d9546d9504
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
38 lines
1,001 B
Rust
38 lines
1,001 B
Rust
use dioxus::prelude::*;
|
|
use dioxus_desktop::tao::dpi::LogicalSize;
|
|
use dioxus_router::{Link, Route, Router};
|
|
|
|
fn main() {
|
|
env_logger::init();
|
|
|
|
dioxus_desktop::launch_cfg(app, |c| {
|
|
c.with_window(|c| {
|
|
c.with_title("Spinsense Client")
|
|
.with_inner_size(LogicalSize::new(600, 1000))
|
|
.with_resizable(false)
|
|
})
|
|
})
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
cx.render(rsx! {
|
|
Router {
|
|
Route { to: "/", "Home" }
|
|
Route { to: "/games", "Games" }
|
|
Route { to: "/play", "Play" }
|
|
Route { to: "/settings", "Settings" }
|
|
|
|
p {
|
|
"----"
|
|
}
|
|
nav {
|
|
ul {
|
|
Link { to: "/", li { "Home" } }
|
|
Link { to: "/games", li { "Games" } }
|
|
Link { to: "/play", li { "Play" } }
|
|
Link { to: "/settings", li { "Settings" } }
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|