forked from RustLangES/RustLangES.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rs
60 lines (57 loc) · 2.14 KB
/
app.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use leptos::{component, view, IntoView};
use leptos_meta::{provide_meta_context, Body};
use leptos_router::{Router, Routes, StaticParamsMap, StaticRoute};
use crate::{
components::{Footer, HeadInformation, Header},
pages::{Aprende, Communidad, Contributors, Index},
};
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
let bg_in_dark_mode = if cfg!(debug_assertions) {
"dark:bg-kaku-dev"
} else {
"dark:bg-kaku"
};
view! {
<Router>
<HeadInformation/>
<Body class=format!(
"bg-orange-200 dark:bg-[#131313]/90 bg-center bg-fixed {} dark:bri dark:bg-cover dark:bg-blend-darken dark:backdrop-blur-xl overflow-x-hidden dark:text-[#e2cea9]",
bg_in_dark_mode,
)/>
<Header/>
<main>
<Routes>
<StaticRoute
path="/"
view=Index
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
<StaticRoute
path="/comunidad"
view=Communidad
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
<StaticRoute
path="/colaboradores"
view=Contributors
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
<StaticRoute
path="/aprende"
view=Aprende
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
<StaticRoute
path="404"
view=Index
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
</Routes>
</main>
<Footer/>
</Router>
}
}