Initial commit.
This commit is contained in:
commit
936ea3d853
40 changed files with 6851 additions and 0 deletions
30
desktop/src/views/blog.rs
Normal file
30
desktop/src/views/blog.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
use crate::Route;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
const BLOG_CSS: Asset = asset!("/assets/blog.css");
|
||||
|
||||
#[component]
|
||||
pub fn Blog(id: i32) -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: BLOG_CSS}
|
||||
|
||||
div {
|
||||
id: "blog",
|
||||
|
||||
// Content
|
||||
h1 { "This is blog #{id}!" }
|
||||
p { "In blog #{id}, we show how the Dioxus router works and how URL parameters can be passed as props to our route components." }
|
||||
|
||||
// Navigation links
|
||||
Link {
|
||||
to: Route::Blog { id: id - 1 },
|
||||
"Previous"
|
||||
}
|
||||
span { " <---> " }
|
||||
Link {
|
||||
to: Route::Blog { id: id + 1 },
|
||||
"Next"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
desktop/src/views/home.rs
Normal file
10
desktop/src/views/home.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
use dioxus::prelude::*;
|
||||
use ui::{Hero, Echo};
|
||||
|
||||
#[component]
|
||||
pub fn Home() -> Element {
|
||||
rsx! {
|
||||
Hero {}
|
||||
Echo {}
|
||||
}
|
||||
}
|
5
desktop/src/views/mod.rs
Normal file
5
desktop/src/views/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
mod home;
|
||||
pub use home::Home;
|
||||
|
||||
mod blog;
|
||||
pub use blog::Blog;
|
Loading…
Add table
Add a link
Reference in a new issue