use rooms::RoomList; use wasm_bindgen::prelude::*; use yew::prelude::*; use yew_router::{components::RouterAnchor, prelude::*}; pub mod grpc; pub mod rooms; #[derive(Switch, Clone, Debug)] pub enum AppRoute { #[to = "/rooms"] Rooms, #[to = "/rooms/{room_id}"] Room(String), #[to = "/"] Index, } type AppRouter = Router; type AppAnchor = RouterAnchor; //For rendering clickable links. fn render_route(switch: AppRoute) -> Html { match switch { AppRoute::Rooms => { html! { } } AppRoute::Room(room_id) => { html! {
{"This is the specifi roompage."}
} } AppRoute::Index => { html! { } } } } // struct AppMenu; // impl Component for AppMenu { // type Message = (); // type Properties = (); // fn create(_: Self::Properties, _link: ComponentLink) -> Self { // Self // } // fn update(&mut self, _msg: Self::Message) -> ShouldRender { // false // } // fn change(&mut self, _: Self::Properties) -> ShouldRender { // false // } // fn view(&self) -> Html { // html! { //
    //
  • // {"Home"} //
  • //
  • // {"Oaths"} //
  • //
  • // {"Commitments"} //
  • //
  • // {"Studies"} //
  • //
  • // {"Runic Divination"} //
  • //
// } // } // } struct App; impl Component for App { type Message = (); type Properties = (); fn create(_: Self::Properties, _link: ComponentLink) -> Self { Self } fn update(&mut self, _: Self::Message) -> ShouldRender { false } fn change(&mut self, _: Self::Properties) -> ShouldRender { false } fn view(&self) -> Html { html! {
{"Hello World"}
} } } #[wasm_bindgen(start)] pub fn run_app() { //App::::new().mount_with_props(body, props); yew::start_app::(); }