2022-03-05 21:10:17 +00:00
|
|
|
use dioxus::prelude::*;
|
2022-09-13 23:22:27 +00:00
|
|
|
use dioxus_desktop::{tao::dpi::LogicalSize, Config, WindowBuilder};
|
2022-07-09 19:15:20 +00:00
|
|
|
use dioxus_router::{Link, Route, Router};
|
2022-03-04 18:08:25 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
env_logger::init();
|
|
|
|
|
2022-09-13 23:22:27 +00:00
|
|
|
let cfg = Config::new().with_window(
|
|
|
|
WindowBuilder::new()
|
|
|
|
.with_title("Spinsense Client")
|
|
|
|
.with_inner_size(LogicalSize::new(600, 1000))
|
|
|
|
.with_resizable(false),
|
|
|
|
);
|
|
|
|
|
|
|
|
dioxus_desktop::launch_cfg(app, cfg)
|
2022-03-04 18:08:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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" } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|