feat: added content to home
This commit is contained in:
parent
b24115ce20
commit
4d8449f63a
|
@ -0,0 +1,8 @@
|
|||
use yew::prelude::*;
|
||||
|
||||
#[function_component]
|
||||
pub fn NotFound() -> Html {
|
||||
html! {
|
||||
<h1>{"404 - Not Found"}</h1>
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
use yew::prelude::*;
|
||||
|
||||
#[function_component]
|
||||
pub fn Home() -> Html {
|
||||
html! {
|
||||
<div class="content">
|
||||
<ul id="content-boxes">
|
||||
<li class="content-box">
|
||||
<p class="content-box-heading">{"Community"}</p>
|
||||
|
||||
<div class="content-box-data">
|
||||
<p>{
|
||||
"Nerdcult is a platform for (and by) open source
|
||||
software developers, that aims to make collaboration
|
||||
as comfortable as possible. We also want to make
|
||||
it as easy as possible for users to find contributors
|
||||
for their projects.
|
||||
Join now by creating an account."
|
||||
}</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="content-box">
|
||||
<p class="content-box-heading">{"Tools"}</p>
|
||||
<div class="content-box-data">
|
||||
<p>{
|
||||
"We provide tools for software development, communication and project management.
|
||||
This includes a git server, a matrix homeserver, pads and much more :)"
|
||||
}</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="content-box">
|
||||
<p class="content-box-heading">{"Privacy"}</p>
|
||||
|
||||
<div class="content-box-data">
|
||||
<p>{
|
||||
"We save as less personal data as possible and our logs are anonymized.
|
||||
Your private data is encrypted with a key that derives from your password.
|
||||
By that we couldn't sell data and give attackers nothing they could steal."
|
||||
}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
pub mod home;
|
||||
pub mod error;
|
15
src/main.rs
15
src/main.rs
|
@ -1,5 +1,10 @@
|
|||
mod content;
|
||||
mod state;
|
||||
mod topbar;
|
||||
|
||||
use content::{error, home::Home};
|
||||
use state::State;
|
||||
use std::rc::Rc;
|
||||
use topbar::TopBar;
|
||||
use yew::prelude::*;
|
||||
use yew_router::prelude::*;
|
||||
|
@ -21,25 +26,27 @@ enum Route {
|
|||
|
||||
fn switch(routes: Route) -> Html {
|
||||
match routes {
|
||||
Route::Home => html! { <h1>{ "Home" }</h1> },
|
||||
Route::Home => html! { <Home/> },
|
||||
Route::Services => html! {<h1>{ "Services" }</h1>},
|
||||
Route::Community => html! {<h1>{ "Community" }</h1>},
|
||||
Route::About => html! {<h1>{ "About" }</h1>},
|
||||
Route::NotFound => html! { <h1>{ "404" }</h1> },
|
||||
Route::NotFound => html! { <error::NotFound/> },
|
||||
}
|
||||
}
|
||||
|
||||
#[function_component]
|
||||
fn App() -> Html {
|
||||
let state = use_memo(|_| State::default(), ());
|
||||
|
||||
html! {
|
||||
<div>
|
||||
<ContextProvider<Rc<State>> context={state}>
|
||||
<TopBar/>
|
||||
<main>
|
||||
<BrowserRouter>
|
||||
<Switch<Route> render={switch} />
|
||||
</BrowserRouter>
|
||||
</main>
|
||||
</div>
|
||||
</ContextProvider<Rc<State>>>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#[derive(Clone, PartialEq)]
|
||||
pub struct State {
|
||||
auth_token: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for State {
|
||||
fn default() -> Self {
|
||||
Self { auth_token: None }
|
||||
}
|
||||
}
|
|
@ -15,9 +15,9 @@ main {
|
|||
}
|
||||
|
||||
.content {
|
||||
margin: 12px;
|
||||
padding: 12px;
|
||||
height: calc(100% - 48px);
|
||||
width: calc(100% - 24px);
|
||||
height: calc(100% - 86px);
|
||||
}
|
||||
|
||||
#content-boxes {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#tabs-account {
|
||||
float: right;
|
||||
margin-right: 32px;
|
||||
margin-right: 24px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
Loading…
Reference in New Issue