diff --git a/src/content/error.rs b/src/content/error.rs new file mode 100644 index 0000000..902ec97 --- /dev/null +++ b/src/content/error.rs @@ -0,0 +1,8 @@ +use yew::prelude::*; + +#[function_component] +pub fn NotFound() -> Html { + html! { +

{"404 - Not Found"}

+ } +} \ No newline at end of file diff --git a/src/content/home.rs b/src/content/home.rs new file mode 100644 index 0000000..69f76d6 --- /dev/null +++ b/src/content/home.rs @@ -0,0 +1,47 @@ +use yew::prelude::*; + +#[function_component] +pub fn Home() -> Html { + html! { +
+ +
+ } +} diff --git a/src/content/mod.rs b/src/content/mod.rs new file mode 100644 index 0000000..d914dc4 --- /dev/null +++ b/src/content/mod.rs @@ -0,0 +1,2 @@ +pub mod home; +pub mod error; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 9b6665d..e3ea2ee 100644 --- a/src/main.rs +++ b/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! {

{ "Home" }

}, + Route::Home => html! { }, Route::Services => html! {

{ "Services" }

}, Route::Community => html! {

{ "Community" }

}, Route::About => html! {

{ "About" }

}, - Route::NotFound => html! {

{ "404" }

}, + Route::NotFound => html! { }, } } #[function_component] fn App() -> Html { + let state = use_memo(|_| State::default(), ()); + html! { -
+ > context={state}>
render={switch} />
-
+ >> } } diff --git a/src/state.rs b/src/state.rs new file mode 100644 index 0000000..9e7d460 --- /dev/null +++ b/src/state.rs @@ -0,0 +1,10 @@ +#[derive(Clone, PartialEq)] +pub struct State { + auth_token: Option, +} + +impl Default for State { + fn default() -> Self { + Self { auth_token: None } + } +} diff --git a/src/topbar.rs b/src/topbar/mod.rs similarity index 100% rename from src/topbar.rs rename to src/topbar/mod.rs diff --git a/style/home.css b/style/home.css index 6068c18..6340fb9 100644 --- a/style/home.css +++ b/style/home.css @@ -15,9 +15,9 @@ main { } .content { + margin: 12px; padding: 12px; - height: calc(100% - 48px); - width: calc(100% - 24px); + height: calc(100% - 86px); } #content-boxes { diff --git a/style/topbar.css b/style/topbar.css index 551fa19..cc9f96d 100644 --- a/style/topbar.css +++ b/style/topbar.css @@ -39,7 +39,7 @@ #tabs-account { float: right; - margin-right: 32px; + margin-right: 24px; padding: 0; list-style: none; } \ No newline at end of file