use yew::prelude::*; use crate::routes::home::student_vote; pub enum Msg { Registered, } #[derive(Properties, PartialEq)] pub struct StudentHomeProps { pub token: String, pub voted: bool, } pub struct StudentHome { voted: bool, } impl Component for StudentHome { type Message = Msg; type Properties = StudentHomeProps; fn create(ctx: &Context) -> Self { Self { voted: ctx.props().voted, } } fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::Registered => { self.voted = true; true } } } fn view(&self, ctx: &Context) -> Html { html! { if self.voted {

{ "Alles in Ordnung." }

} else { } } } }