46 lines
1.5 KiB
Rust
46 lines
1.5 KiB
Rust
use crate::components::BackgroundProps;
|
|
use crate::components::Background;
|
|
use crate::routes::whymdc::*;
|
|
use crate::routes::home::*;
|
|
use crate::routes::blog::*;
|
|
use leptos::*;
|
|
use leptos_meta::*;
|
|
use leptos_router::*;
|
|
|
|
#[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/leptos_start.css"/>
|
|
|
|
// sets the document title
|
|
<Title text="NationTech"/>
|
|
|
|
// content for this welcome page
|
|
<Router>
|
|
<main class="text-white bg-indigo-950 min-h-screen ">
|
|
<Background />
|
|
<div class="max-w-3xl container mx-auto p-4 md:p-0 md:pb-14">
|
|
<nav class="py-4 flex space-x-4">
|
|
<a href="/">"Home"</a>
|
|
<a href="/blog">"Blog"</a>
|
|
</nav>
|
|
<hr />
|
|
<Routes>
|
|
<Route path="" view=|cx| view! { cx, <HomePage/> }/>
|
|
<Route path="/why-micro-datacenters" view=|cx| view! { cx, <WhyMicroDatacenters/> }/>
|
|
<Route path="/blog" view=|cx| view! { cx, <Blog/> }/>
|
|
</Routes>
|
|
</div>
|
|
</main>
|
|
</Router>
|
|
}
|
|
}
|
|
|