Added basic navigation components

This commit is contained in:
xeovalyte 2024-07-26 13:39:50 +02:00
parent 6d6b2c57c5
commit cf12fc51d7
Signed by: xeovalyte
SSH Key Fingerprint: SHA256:kSQDrQDmKzljJzfGYcd3m9RqHi4h8rSwkZ3sQ9kBURo
7 changed files with 45 additions and 3 deletions

View File

@ -1,3 +1,6 @@
pub mod admin; pub mod admin;
pub mod agenda;
pub mod home; pub mod home;
pub mod layout; pub mod layout;
pub mod news;
pub mod settings;

10
src/components/agenda.rs Normal file
View File

@ -0,0 +1,10 @@
use dioxus::prelude::*;
#[component]
pub fn Agenda() -> Element {
rsx! {
div {
h1 { class: "text-xl font-bold text-primary", "Agenda" }
}
}
}

View File

@ -17,13 +17,13 @@ pub fn Navbar() -> Element {
"Home" "Home"
}, },
Link { Link {
to: Route::Home {}, to: Route::News {},
class: "btn btn-ghost flex-col flex-nowrap py-1 gap-1 font-normal h-max", class: "btn btn-ghost flex-col flex-nowrap py-1 gap-1 font-normal h-max",
icons::Newspaper {}, icons::Newspaper {},
div { class: "font-normal", "Nieuws" } div { class: "font-normal", "Nieuws" }
}, },
Link { Link {
to: Route::Home {}, to: Route::Agenda {},
class: "btn btn-ghost flex-col flex-nowrap py-1 gap-1 font-normal h-max", class: "btn btn-ghost flex-col flex-nowrap py-1 gap-1 font-normal h-max",
icons::Calendar {}, icons::Calendar {},
span { class: "font-normal", "Agenda" } span { class: "font-normal", "Agenda" }

View File

@ -21,7 +21,7 @@ pub fn Topbar() -> Element {
} }
Link { Link {
class: "btn btn-square btn-ghost", class: "btn btn-square btn-ghost",
to: Route::Home {}, to: Route::Settings {},
icons::Cog {} icons::Cog {}
} }
} }

10
src/components/news.rs Normal file
View File

@ -0,0 +1,10 @@
use dioxus::prelude::*;
#[component]
pub fn News() -> Element {
rsx! {
div {
h1 { class: "text-xl font-bold text-primary", "Nieuws" }
}
}
}

View File

@ -0,0 +1,10 @@
use dioxus::prelude::*;
#[component]
pub fn Settings() -> Element {
rsx! {
div {
h1 { class: "text-xl font-bold text-primary", "Settings" }
}
}
}

View File

@ -8,13 +8,22 @@ use tracing::{info, Level};
// Use routes // Use routes
use components::admin::members::migration::Migration; use components::admin::members::migration::Migration;
use components::agenda::Agenda;
use components::home::Home; use components::home::Home;
use components::news::News;
use components::settings::Settings;
#[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)] #[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum Route { pub enum Route {
#[layout(Wrapper)] #[layout(Wrapper)]
#[route("/")] #[route("/")]
Home {}, Home {},
#[route("/agenda")]
Agenda {},
#[route("/news")]
News {},
#[route("/settings")]
Settings {},
#[route("/admin/members/migration")] #[route("/admin/members/migration")]
Migration {}, Migration {},
} }