Added wireframe layout leptos
This commit is contained in:
parent
ce2cac6103
commit
3cdbfe78f9
@ -37,3 +37,41 @@ a {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.route-active {
|
||||||
|
color: $primary-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
background-color: $secondary-bg-color;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar > a {
|
||||||
|
margin: 0px 20px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
transition: all 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar > a:hover {
|
||||||
|
background-color: $primary-color-light;
|
||||||
|
color: $text-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-add-link {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 0;
|
||||||
|
background-color: $secondary-bg-color;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: dashed $secondary-bg-color-lighter;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-add-link:hover {
|
||||||
|
background-color: $secondary-bg-color-light;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
|
pub mod navbar;
|
||||||
|
|
||||||
|
14
application/src/components/navbar.rs
Normal file
14
application/src/components/navbar.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
use leptos::*;
|
||||||
|
use leptos_router::*;
|
||||||
|
|
||||||
|
/// Navigation bar
|
||||||
|
#[component]
|
||||||
|
pub fn Navbar() -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<div class="navbar">
|
||||||
|
<A href="/" active_class="route-active">Home</A>
|
||||||
|
<A href="/participants" active_class="route-active">Deelnemers</A>
|
||||||
|
<A href="/times" active_class="route-active">Tijden</A>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,8 @@ mod pages;
|
|||||||
// Top-Level pages
|
// Top-Level pages
|
||||||
use crate::pages::home::Home;
|
use crate::pages::home::Home;
|
||||||
use crate::pages::not_found::NotFound;
|
use crate::pages::not_found::NotFound;
|
||||||
|
use crate::pages::participants;
|
||||||
|
use crate::pages::times;
|
||||||
|
|
||||||
/// An app router which renders the homepage and handles 404's
|
/// An app router which renders the homepage and handles 404's
|
||||||
#[component]
|
#[component]
|
||||||
@ -49,10 +51,16 @@ pub fn App() -> impl IntoView {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Router>
|
<Router>
|
||||||
|
<components::navbar::Navbar />
|
||||||
|
<main>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" view=Home />
|
<Route path="/" view=Home />
|
||||||
|
<Route path="/participants" view=participants::Participants />
|
||||||
|
<Route path="/participants/add" view=participants::add::Add />
|
||||||
|
<Route path="/times" view=times::Times />
|
||||||
<Route path="/*" view=NotFound />
|
<Route path="/*" view=NotFound />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
</main>
|
||||||
</Router>
|
</Router>
|
||||||
|
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
pub mod home;
|
pub mod home;
|
||||||
pub mod not_found;
|
pub mod not_found;
|
||||||
|
pub mod participants;
|
||||||
|
pub mod times;
|
||||||
|
12
application/src/pages/participants.rs
Normal file
12
application/src/pages/participants.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
use leptos::*;
|
||||||
|
use leptos_router::*;
|
||||||
|
|
||||||
|
pub mod add;
|
||||||
|
|
||||||
|
/// Default Home Page
|
||||||
|
#[component]
|
||||||
|
pub fn Participants() -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<A class="btn-add-link" href="/participants/add">"Deelnemer toevoegen"</A>
|
||||||
|
}
|
||||||
|
}
|
9
application/src/pages/participants/add.rs
Normal file
9
application/src/pages/participants/add.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
use leptos::*;
|
||||||
|
|
||||||
|
/// Navigation bar
|
||||||
|
#[component]
|
||||||
|
pub fn Add() -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<h1>"Deelnemer toevoegen"</h1>
|
||||||
|
}
|
||||||
|
}
|
15
application/src/pages/times.rs
Normal file
15
application/src/pages/times.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use leptos::*;
|
||||||
|
|
||||||
|
pub mod add;
|
||||||
|
|
||||||
|
/// Default Home Page
|
||||||
|
#[component]
|
||||||
|
pub fn Times() -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<h1>"Tijden"</h1>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
9
application/src/pages/times/add.rs
Normal file
9
application/src/pages/times/add.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
use leptos::*;
|
||||||
|
|
||||||
|
/// Navigation bar
|
||||||
|
#[component]
|
||||||
|
pub fn Add() -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<h1>"Deelnemer toevoegen"</h1>
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user