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::*; #[derive(Clone, Routable, PartialEq)] enum Route { #[at("/")] Home, #[at("/services")] Services, #[at("/community")] Community, #[at("/about")] About, #[not_found] #[at("/404")] NotFound, } fn switch(routes: Route) -> Html { match routes { Route::Home => html! { }, Route::Services => html! {

{ "Services" }

}, Route::Community => html! {

{ "Community" }

}, Route::About => html! {

{ "About" }

}, Route::NotFound => html! { }, } } #[function_component] fn App() -> Html { let state = use_memo(|_| State::default(), ()); html! { > context={state}>
render={switch} />
>> } } fn main() { yew::Renderer::::new().render(); }