collab_notification.rs

 1use gpui::prelude::*;
 2use story::{StoryContainer, StoryItem, StorySection};
 3use ui::prelude::*;
 4
 5use crate::notifications::collab_notification::CollabNotification;
 6
 7pub struct CollabNotificationStory;
 8
 9impl Render for CollabNotificationStory {
10    fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
11        let window_container = |width, height| div().w(px(width)).h(px(height));
12
13        StoryContainer::new(
14            "CollabNotification Story",
15            "crates/collab_ui/src/notifications/stories/collab_notification.rs",
16        )
17        .child(
18            StorySection::new().child(StoryItem::new(
19                "Incoming Call Notification",
20                window_container(400., 72.).child(
21                    CollabNotification::new(
22                        "https://avatars.githubusercontent.com/u/1486634?v=4",
23                        Button::new("accept", "Accept"),
24                        Button::new("decline", "Decline"),
25                    )
26                    .child(
27                        v_flex()
28                            .overflow_hidden()
29                            .child(Label::new("maxdeviant is sharing a project in Zed")),
30                    ),
31                ),
32            )),
33        )
34        .child(
35            StorySection::new().child(StoryItem::new(
36                "Project Shared Notification",
37                window_container(400., 72.).child(
38                    CollabNotification::new(
39                        "https://avatars.githubusercontent.com/u/1714999?v=4",
40                        Button::new("open", "Open"),
41                        Button::new("dismiss", "Dismiss"),
42                    )
43                    .child(Label::new("iamnbutler"))
44                    .child(Label::new("is sharing a project in Zed:"))
45                    .child(Label::new("zed")),
46                ),
47            )),
48        )
49    }
50}