mentorenwahl/frontend/src/routes/settings/mod.rs
Dominic Grimm 8055a5e4db
Some checks failed
continuous-integration/drone/push Build is failing
Update
2023-01-17 06:56:19 +01:00

45 lines
1.2 KiB
Rust

use yew::prelude::*;
use crate::components;
pub mod assignments;
pub mod new_user_modal;
pub mod tokens;
pub mod users;
#[derive(Properties, PartialEq, Eq)]
pub struct SettingsProps {
pub token: Option<String>,
pub admin: bool,
}
pub struct Settings;
impl Component for Settings {
type Message = ();
type Properties = SettingsProps;
fn create(_ctx: &Context<Self>) -> Self {
Self
}
fn view(&self, ctx: &Context<Self>) -> Html {
html! {
<>
<components::title::Title title="Settings" />
<section class={classes!("block")}>
<tokens::Tokens token={ctx.props().token.as_ref().unwrap().to_owned()} />
</section>
if ctx.props().admin {
<section class={classes!("block")}>
<assignments::Assignments token={ctx.props().token.as_ref().unwrap().to_owned()} />
</section>
<section class={classes!("block")}>
<users::Users token={ctx.props().token.as_ref().unwrap().to_owned()} />
</section>
}
</>
}
}
}