2024-07-18 04:00:56 -04:00
|
|
|
use leptos::*;
|
|
|
|
use leptos_meta::*;
|
|
|
|
use leptos_router::*;
|
|
|
|
|
|
|
|
// Modules
|
|
|
|
mod components;
|
|
|
|
mod pages;
|
|
|
|
|
|
|
|
// Top-Level pages
|
|
|
|
use crate::pages::home::Home;
|
|
|
|
use crate::pages::not_found::NotFound;
|
|
|
|
|
|
|
|
/// An app router which renders the homepage and handles 404's
|
|
|
|
#[component]
|
|
|
|
pub fn App() -> impl IntoView {
|
|
|
|
// Provides context that manages stylesheets, titles, meta tags, etc.
|
|
|
|
provide_meta_context();
|
|
|
|
|
|
|
|
view! {
|
2024-08-14 20:39:26 -04:00
|
|
|
<Html class="bg-neutral-900" lang="en" dir="ltr" attr:data-theme="dark" />
|
2024-07-18 04:00:56 -04:00
|
|
|
|
|
|
|
// sets the document title
|
2024-08-14 20:39:26 -04:00
|
|
|
<Title text="Cards for Humanity" />
|
2024-07-18 04:00:56 -04:00
|
|
|
|
|
|
|
// injects metadata in the <head> of the page
|
2024-08-14 20:39:26 -04:00
|
|
|
<Meta charset="UTF-8" />
|
|
|
|
<Meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
2024-07-18 04:00:56 -04:00
|
|
|
|
|
|
|
<Router>
|
|
|
|
<Routes>
|
2024-08-14 20:39:26 -04:00
|
|
|
<Route path="/" view=Home />
|
|
|
|
<Route path="/*" view=NotFound />
|
2024-07-18 04:00:56 -04:00
|
|
|
</Routes>
|
|
|
|
</Router>
|
|
|
|
}
|
|
|
|
}
|