Move Route and App out of main
All checks were successful
Push Workflows / rustfmt (push) Successful in 5s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / test (push) Successful in 17s
Push Workflows / docs (push) Successful in 17s
Push Workflows / clippy (push) Successful in 15s
Push Workflows / build (push) Successful in 42s
Push Workflows / nix-build (push) Successful in 5m0s
All checks were successful
Push Workflows / rustfmt (push) Successful in 5s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / test (push) Successful in 17s
Push Workflows / docs (push) Successful in 17s
Push Workflows / clippy (push) Successful in 15s
Push Workflows / build (push) Successful in 42s
Push Workflows / nix-build (push) Successful in 5m0s
This commit is contained in:
29
src/app.rs
Normal file
29
src/app.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
|
||||
|
||||
#[derive(Debug, Clone, Routable, PartialEq)]
|
||||
#[rustfmt::skip]
|
||||
enum Route {
|
||||
#[route("/")]
|
||||
Home {},
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub 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!"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user