Some checks failed
Push Workflows / build (push) Failing after 4s
Push Workflows / rustfmt (push) Successful in 6s
Push Workflows / test (push) Failing after 39s
Push Workflows / clippy (push) Failing after 36s
Push Workflows / docs (push) Failing after 43s
Push Workflows / nix-build (push) Failing after 2m6s
49 lines
833 B
Rust
49 lines
833 B
Rust
use dioxus::prelude::*;
|
|
|
|
pub mod api;
|
|
pub mod components;
|
|
pub mod models;
|
|
pub mod pages;
|
|
pub mod schema;
|
|
|
|
#[cfg(feature = "server")]
|
|
pub mod server;
|
|
|
|
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
|
|
|
|
#[derive(Debug, Clone, Routable, PartialEq)]
|
|
#[rustfmt::skip]
|
|
enum Route {
|
|
#[route("/")]
|
|
Home {},
|
|
}
|
|
|
|
#[component]
|
|
fn App() -> Element {
|
|
rsx! {
|
|
document::Link { rel: "stylesheet", href: TAILWIND_CSS }
|
|
Router::<Route> {}
|
|
}
|
|
}
|
|
|
|
/// Home page
|
|
#[component]
|
|
fn Home() -> Element {
|
|
rsx! {
|
|
p {
|
|
class: "text-lg",
|
|
"Hello, world!"
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
#[cfg(debug_assertions)]
|
|
dioxus::logger::init(tracing::Level::DEBUG).expect("Failed to initialize tracing logger");
|
|
|
|
#[cfg(feature = "server")]
|
|
server::main();
|
|
|
|
dioxus::launch(App);
|
|
}
|