2023-07-02 04:52:35 -04:00
|
|
|
use crate::error_template::{AppError, ErrorTemplate};
|
2024-01-05 05:19:12 -05:00
|
|
|
|
2023-07-02 04:52:35 -04:00
|
|
|
use leptos::*;
|
|
|
|
use leptos_meta::*;
|
|
|
|
use leptos_router::*;
|
2024-01-05 05:19:12 -05:00
|
|
|
use crate::routes::{blog::*, home::*,projects::*};
|
2023-07-02 04:52:35 -04:00
|
|
|
|
|
|
|
#[component]
|
|
|
|
pub fn App(cx: Scope) -> impl IntoView {
|
|
|
|
// Provides context that manages stylesheets, titles, meta tags, etc.
|
|
|
|
provide_meta_context(cx);
|
|
|
|
|
|
|
|
view! {
|
|
|
|
cx,
|
|
|
|
// injects a stylesheet into the document <head>
|
|
|
|
// id=leptos means cargo-leptos will hot-reload this stylesheet
|
|
|
|
<Stylesheet id="leptos" href="/pkg/doordesk.css"/>
|
|
|
|
|
|
|
|
// sets the document title
|
2024-01-05 05:19:12 -05:00
|
|
|
<Title text="doordesk"/>
|
2023-07-02 04:52:35 -04:00
|
|
|
|
|
|
|
// content for this welcome page
|
|
|
|
<Router fallback=|cx| {
|
|
|
|
let mut outside_errors = Errors::default();
|
|
|
|
outside_errors.insert_with_default_key(AppError::NotFound);
|
|
|
|
view! { cx,
|
|
|
|
<ErrorTemplate outside_errors/>
|
|
|
|
}
|
|
|
|
.into_view(cx)
|
|
|
|
}>
|
2023-07-10 20:59:52 -04:00
|
|
|
<nav class="bg-gradient-to-b from-zinc-800 to-zinc-900 shadow-lg sticky top-0">
|
|
|
|
<ul class="container flex items-center p-3">
|
|
|
|
<li class="mx-1.5 sm:mx-6">
|
|
|
|
"DoorDesk"
|
|
|
|
</li>
|
|
|
|
<li class="mx-1.5 sm:mx-6">
|
|
|
|
<A href="" exact=true>"Home"</A>
|
|
|
|
</li>
|
|
|
|
<li class="mx-1.5 sm:mx-6">
|
|
|
|
<A href="/blog">"Blog"</A>
|
|
|
|
</li>
|
|
|
|
<li class="mx-1.5 sm:mx-6">
|
|
|
|
<A href="/projects">"Projects"</A>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2023-07-02 04:52:35 -04:00
|
|
|
<main>
|
|
|
|
<Routes>
|
2023-07-10 20:59:52 -04:00
|
|
|
<Route path="/" view=|cx| view! { cx, <Home /> }/>
|
|
|
|
<Route path="/blog" view=|cx| view! { cx, <Blog /> }/>
|
|
|
|
<Route path="/projects" view=|cx| view! { cx, <Projects /> }/>
|
2023-07-02 04:52:35 -04:00
|
|
|
</Routes>
|
|
|
|
</main>
|
2024-01-05 05:19:12 -05:00
|
|
|
<p class="text-center hover:rotate-180 duration-200 w-8 m-auto">
|
|
|
|
<a href="https://open.spotify.com/playlist/3JRNw9gpt1w5ptsw8uDeYc?si=8f7e4191113f41f9">":)"</a>
|
|
|
|
</p>
|
|
|
|
<br />
|
2023-07-02 04:52:35 -04:00
|
|
|
</Router>
|
|
|
|
}
|
|
|
|
}
|