mentorenwahl/frontend/src/routes/home/student_home.rs

31 lines
644 B
Rust

use yew::prelude::*;
use crate::routes::home::student_vote;
#[derive(Properties, PartialEq)]
pub struct StudentHomeProps {
pub token: String,
pub voted: bool,
}
pub struct StudentHome;
impl Component for StudentHome {
type Message = ();
type Properties = StudentHomeProps;
fn create(_ctx: &Context<Self>) -> Self {
Self
}
fn view(&self, ctx: &Context<Self>) -> Html {
html! {
if ctx.props().voted {
<p>{ "Alles in Ordnung." }</p>
} else {
<student_vote::StudentVote token={ctx.props().token.to_owned()} />
}
}
}
}