mod topbar; use yew::prelude::*; use yew_router::prelude::*; use topbar::TopBar; #[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! {

{ "Home" }

}, Route::Services => html! {

{ "Services" }

}, Route::Community => html! {

{ "Community" }

}, Route::About => html! {

{ "About" }

}, Route::NotFound => html! {

{ "404" }

}, } } #[function_component] fn App() -> Html { html! {
render={switch} />
} } fn main() { yew::Renderer::::new().render(); }