move front end files into repo
This commit is contained in:
11
AobaClient/src/components/main_layout.rs
Normal file
11
AobaClient/src/components/main_layout.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::{components::Navbar, Route};
|
||||
|
||||
#[component]
|
||||
pub fn MainLayout() -> Element {
|
||||
rsx! {
|
||||
Navbar {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
4
AobaClient/src/components/mod.rs
Normal file
4
AobaClient/src/components/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
mod main_layout;
|
||||
mod navbar;
|
||||
pub use main_layout::MainLayout;
|
||||
pub use navbar::Navbar;
|
||||
49
AobaClient/src/components/navbar.rs
Normal file
49
AobaClient/src/components/navbar.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::Route;
|
||||
|
||||
const NAV_CSS: Asset = asset!("/assets/style/nav.scss");
|
||||
|
||||
#[component]
|
||||
pub fn Navbar() -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: NAV_CSS }
|
||||
nav {
|
||||
Branding {}
|
||||
MainNaviagation {}
|
||||
Widgets {}
|
||||
Utils {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn MainNaviagation() -> Element {
|
||||
rsx! {
|
||||
div { class: "mainNav",
|
||||
Link { class: "navItem", to: Route::Home {}, "Home" }
|
||||
Link { class: "navItem", to: Route::Settings {}, "Settings" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Branding() -> Element {
|
||||
rsx! {
|
||||
div { class: "branding" }
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Widgets() -> Element {
|
||||
rsx! {
|
||||
div { class: "widgets" }
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Utils() -> Element {
|
||||
rsx! {
|
||||
div { class: "utils" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user