Fix borked layout

This commit is contained in:
Julia 2023-12-12 17:22:49 -05:00
parent 01d4e711d8
commit 51ceb52931

View file

@ -231,77 +231,66 @@ impl NotificationPanel {
Some(
div()
.id(ix)
.child(
ButtonLike::new(ix)
h_stack()
.children(actor.map(|actor| Avatar::new(actor.avatar_uri.clone())))
.child(
h_stack()
.children(actor.map(|actor| Avatar::new(actor.avatar_uri.clone())))
.child(
v_stack().child(Label::new(text)).child(
h_stack()
.child(Label::new(format_timestamp(
timestamp,
now,
self.local_timezone,
)))
.children(if let Some(is_accepted) = response {
Some(div().child(Label::new(if is_accepted {
"You accepted"
} else {
"You declined"
})))
} else if needs_response {
Some(
h_stack()
.child(
Button::new("decline", "Decline")
.on_click({
let notification =
notification.clone();
let view = cx.view().clone();
move |_, cx| {
view.update(cx, |this, cx| {
v_stack().child(Label::new(text)).child(
h_stack()
.child(Label::new(format_timestamp(
timestamp,
now,
self.local_timezone,
)))
.children(if let Some(is_accepted) = response {
Some(div().child(Label::new(if is_accepted {
"You accepted"
} else {
"You declined"
})))
} else if needs_response {
Some(
h_stack()
.child(Button::new("decline", "Decline").on_click(
{
let notification = notification.clone();
let view = cx.view().clone();
move |_, cx| {
view.update(cx, |this, cx| {
this.respond_to_notification(
notification.clone(),
false,
cx,
)
});
}
}),
)
.child(
Button::new("accept", "Accept")
.on_click({
let notification =
notification.clone();
let view = cx.view().clone();
move |_, cx| {
view.update(cx, |this, cx| {
}
},
))
.child(Button::new("accept", "Accept").on_click({
let notification = notification.clone();
let view = cx.view().clone();
move |_, cx| {
view.update(cx, |this, cx| {
this.respond_to_notification(
notification.clone(),
true,
cx,
)
});
}
}),
),
)
} else {
None
}),
),
),
)
.disabled(!can_navigate)
.on_click({
let notification = notification.clone();
cx.listener(move |this, _, cx| {
this.did_click_notification(&notification, cx)
})
}),
}
})),
)
} else {
None
}),
),
),
)
.on_click({
let notification = notification.clone();
cx.listener(move |this, _, cx| this.did_click_notification(&notification, cx))
})
.into_any(),
)
}