From 85e388455a09e307fea14e4c98ece65c463b7773 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 30 Oct 2022 17:13:41 +0100 Subject: Frontend: Update yew to follow master This enables us to use the new Router API --- frontend/src/app.rs | 2 +- frontend/src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/app.rs b/frontend/src/app.rs index a1f63de..d98b955 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -82,7 +82,7 @@ impl Component for OSSE { } fn view(&self, ctx: &Context) -> Html { - let onsubmit = ctx.link().callback(|event: FocusEvent| { + let onsubmit = ctx.link().callback(|event: SubmitEvent| { event.prevent_default(); OSSEMessage::SearchSubmitted diff --git a/frontend/src/main.rs b/frontend/src/main.rs index 95b52e5..fd5ef3c 100644 --- a/frontend/src/main.rs +++ b/frontend/src/main.rs @@ -13,7 +13,7 @@ enum Route { OSSESearch { query: String }, } -fn switch_routes(routes: &Route) -> Html { +fn switch_routes(routes: Route) -> Html { match routes { Route::OSSEHome => html! { @@ -29,12 +29,12 @@ fn yew_app() -> Html { html! { <> - render={Switch::render(switch_routes)} /> + render={switch_routes} /> } } fn main() { - yew::start_app::(); + yew::Renderer::::new().render(); } -- cgit 1.4.1