summaryrefslogtreecommitdiff
path: root/src/view/property_group.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/property_group.rs')
-rw-r--r--src/view/property_group.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/view/property_group.rs b/src/view/property_group.rs
index f4b62a4..1905cac 100644
--- a/src/view/property_group.rs
+++ b/src/view/property_group.rs
@@ -9,6 +9,7 @@ pub struct InputProps<
M: 'static + PartialEq + Clone,
> {
pub generated: Callback<O>,
+ pub delete: Callback<()>,
pub weak_link: WeakComponentLink<PropertyGroupInputComponent<O, M>>,
}
@@ -43,12 +44,20 @@ impl<O: 'static + VCardPropertyInputGroupObject<M>, M: 'static + PartialEq + Clo
}
fn view(&self) -> yew::virtual_dom::VNode {
let link = self.props.weak_link.borrow().clone().unwrap();
+ let delete = self.props.delete.clone();
html! {
<div class="box">
{ self.render_error() }
- <h3 class="subtitle">{ self.value.get_title() }</h3>
+ <div class="level">
+ <div class="level-left">
+ <h3 class="subtitle">{ self.value.get_title() }</h3>
+ </div>
+ <div class="level-right">
+ <button onclick=Callback::once(move |_| delete.emit(())) class="delete"></button>
+ </div>
+ </div>
{ self.value.render(&link) }