Fix positioning of right items
This commit is contained in:
parent
87f879bfa9
commit
b0b4610a73
1 changed files with 21 additions and 10 deletions
|
@ -227,9 +227,13 @@ impl NotificationPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(
|
Some(
|
||||||
h_stack()
|
div()
|
||||||
.id(ix)
|
.id(ix)
|
||||||
|
.flex()
|
||||||
|
.flex_row()
|
||||||
.size_full()
|
.size_full()
|
||||||
|
.px_2()
|
||||||
|
.py_1()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.when(can_navigate, |el| {
|
.when(can_navigate, |el| {
|
||||||
el.cursor(CursorStyle::PointingHand).on_click({
|
el.cursor(CursorStyle::PointingHand).on_click({
|
||||||
|
@ -239,9 +243,13 @@ impl NotificationPanel {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.children(
|
.children(actor.map(|actor| {
|
||||||
actor.map(|actor| img(actor.avatar_uri.clone()).w_8().h_8().rounded_full()),
|
img(actor.avatar_uri.clone())
|
||||||
)
|
.flex_none()
|
||||||
|
.w_8()
|
||||||
|
.h_8()
|
||||||
|
.rounded_full()
|
||||||
|
}))
|
||||||
.child(
|
.child(
|
||||||
v_stack()
|
v_stack()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
|
@ -249,7 +257,6 @@ impl NotificationPanel {
|
||||||
.child(Label::new(text.clone()))
|
.child(Label::new(text.clone()))
|
||||||
.child(
|
.child(
|
||||||
h_stack()
|
h_stack()
|
||||||
.justify_between()
|
|
||||||
.child(
|
.child(
|
||||||
Label::new(format_timestamp(
|
Label::new(format_timestamp(
|
||||||
timestamp,
|
timestamp,
|
||||||
|
@ -259,14 +266,18 @@ impl NotificationPanel {
|
||||||
.color(Color::Muted),
|
.color(Color::Muted),
|
||||||
)
|
)
|
||||||
.children(if let Some(is_accepted) = response {
|
.children(if let Some(is_accepted) = response {
|
||||||
Some(div().child(Label::new(if is_accepted {
|
Some(div().flex().flex_grow().justify_end().child(Label::new(
|
||||||
|
if is_accepted {
|
||||||
"You accepted"
|
"You accepted"
|
||||||
} else {
|
} else {
|
||||||
"You declined"
|
"You declined"
|
||||||
})))
|
},
|
||||||
|
)))
|
||||||
} else if needs_response {
|
} else if needs_response {
|
||||||
Some(
|
Some(
|
||||||
h_stack()
|
h_stack()
|
||||||
|
.flex_grow()
|
||||||
|
.justify_end()
|
||||||
.child(Button::new("decline", "Decline").on_click({
|
.child(Button::new("decline", "Decline").on_click({
|
||||||
let notification = notification.clone();
|
let notification = notification.clone();
|
||||||
let view = cx.view().clone();
|
let view = cx.view().clone();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue