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

This commit is contained in:
2026-06-21 16:45:53 -04:00
parent a6b635fef0
commit 345e1cc565
2 changed files with 31 additions and 29 deletions

29
src/app.rs Normal file
View 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!"
}
}
}

View File

@@ -1,6 +1,5 @@
use dioxus::prelude::*;
pub mod api;
pub mod app;
pub mod components;
pub mod models;
pub mod pages;
@@ -10,33 +9,7 @@ pub mod util;
#[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!"
}
}
}
use crate::app::App;
fn tracing_setup() {
#[cfg(debug_assertions)]