mentorenwahl/frontend/src/routes/not_found.rs

33 lines
726 B
Rust
Raw Normal View History

2022-11-04 20:23:36 +00:00
use yew::prelude::*;
2022-11-12 21:50:06 +00:00
use yew_side_effect::title::Title;
2022-11-04 20:23:36 +00:00
2022-11-25 22:21:21 +00:00
use crate::layouts;
#[derive(Properties, PartialEq)]
pub struct NotFoundProps {
pub token: Option<String>,
pub logged_in: bool,
}
2022-11-12 21:50:06 +00:00
pub struct NotFound;
impl Component for NotFound {
type Message = ();
2022-11-25 22:21:21 +00:00
type Properties = NotFoundProps;
2022-11-12 21:50:06 +00:00
fn create(_ctx: &Context<Self>) -> Self {
Self
}
2022-11-25 22:21:21 +00:00
fn view(&self, ctx: &Context<Self>) -> Html {
2022-11-12 21:50:06 +00:00
html! {
<>
<Title value="404 Not found" />
2022-11-25 22:21:21 +00:00
<layouts::main::Main token={ctx.props().token.to_owned()} logged_in={ctx.props().logged_in}>
<h1>{ "404" }</h1>
</layouts::main::Main>
2022-11-12 21:50:06 +00:00
</>
}
2022-11-04 20:23:36 +00:00
}
}