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