Add additional notifications and style tweaks

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Nate Butler 2023-11-01 16:50:59 -04:00
parent be3cc6458c
commit 229ba0744e
3 changed files with 111 additions and 22 deletions

View file

@ -1,6 +1,6 @@
use crate::{
h_stack, prelude::*, static_new_notification_items, v_stack, Avatar, Button, Icon, IconButton,
IconElement, Label, LabelColor, LineHeightStyle, ListHeaderMeta, ListSeparator,
h_stack, prelude::*, static_new_notification_items_2, v_stack, Avatar, Button, Icon,
IconButton, IconElement, Label, LabelColor, LineHeightStyle, ListHeaderMeta, ListSeparator,
UnreadIndicator,
};
use crate::{ClickHandler, ListHeader};
@ -51,17 +51,11 @@ impl NotificationsPanel {
.line_height_style(LineHeightStyle::UILabel),
),
)
.children(static_new_notification_items()),
.child(v_stack().px_1().children(static_new_notification_items_2())),
)
}
}
pub enum NotificationItem<V: 'static> {
Message(Notification<V>),
// WithEdgeHeader(Notification<V>),
WithRequiredActions(NotificationWithActions<V>),
}
pub enum ButtonOrIconButton<V: 'static> {
Button(Button<V>),
IconButton(IconButton<V>),
@ -106,11 +100,6 @@ impl<V: 'static> NotificationAction<V> {
}
}
pub struct NotificationWithActions<V: 'static> {
notification: Notification<V>,
actions: [NotificationAction<V>; 2],
}
pub enum ActorOrIcon {
Actor(PublicActor),
Icon(Icon),
@ -280,21 +269,29 @@ impl<V> Notification<V> {
div()
.relative()
.id(self.id.clone())
.p_1()
.flex()
.flex_col()
.w_full()
.children(
Some(
div()
.absolute()
.left(px(3.0))
.top_3()
.z_index(2)
.child(UnreadIndicator::new()),
)
.filter(|_| self.unread),
)
.child(
v_stack()
.z_index(1)
.gap_1()
.w_full()
.child(
h_stack()
.w_full()
.gap_2()
.child(self.render_slot(cx))
.child(div().flex_1().child(Label::new(self.message.clone()))),