use yew::prelude::*; pub enum Msg { CloseModal, Save, } #[derive(Properties, PartialEq)] pub struct NewUserModalProps { pub close: Callback<()>, pub active: bool, } pub struct NewUserModal { username: NodeRef, admin: NodeRef, } impl Component for NewUserModal { type Message = Msg; type Properties = NewUserModalProps; fn create(_ctx: &Context) -> Self { Self { username: NodeRef::default(), admin: NodeRef::default(), } } fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::CloseModal => { ctx.props().close.emit(()); false } Msg::Save => { log::debug!("self.username = {:?}", self.username); log::debug!("self.admin = {:?}", self.admin); true } } } fn view(&self, ctx: &Context) -> Html { let close = ctx.link().callback(|_| Msg::CloseModal); html! {

{ "Neuer Benutzer" }

} } }