Checkpoint – Notifications Panel

This commit is contained in:
Nate Butler 2023-10-19 20:04:21 -04:00
parent e3d948f60b
commit 32028fbbb1
10 changed files with 318 additions and 107 deletions

View file

@ -4,13 +4,13 @@ use std::str::FromStr;
use gpui3::WindowContext;
use rand::Rng;
use crate::HighlightedText;
use crate::{
Buffer, BufferRow, BufferRows, EditorPane, FileSystemStatus, GitStatus, HighlightedLine, Icon,
Keybinding, Label, LabelColor, ListEntry, ListEntrySize, ListItem, Livestream, MicStatus,
ModifierKeys, PaletteItem, Player, PlayerCallStatus, PlayerWithCallStatus, ScreenShareStatus,
Symbol, Tab, ThemeColor, ToggleState, VideoStatus,
Buffer, BufferRow, BufferRows, Button, EditorPane, FileSystemStatus, GitStatus,
HighlightedLine, Icon, Keybinding, Label, LabelColor, ListEntry, ListEntrySize, ListItem,
Livestream, MicStatus, ModifierKeys, PaletteItem, Player, PlayerCallStatus,
PlayerWithCallStatus, ScreenShareStatus, Symbol, Tab, ThemeColor, ToggleState, VideoStatus,
};
use crate::{HighlightedText, ListDetailsEntry};
pub fn static_tabs_example<S: 'static + Send + Sync + Clone>() -> Vec<Tab<S>> {
vec![
@ -324,6 +324,34 @@ pub fn static_players_with_call_status() -> Vec<PlayerWithCallStatus> {
]
}
pub fn static_new_notification_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {
vec![
ListEntry::new(Label::new(
"maxdeviant invited you to join a stream in #design.",
))
.set_left_icon(Icon::FileLock.into()),
ListEntry::new(Label::new("nathansobo accepted your contact request."))
.set_left_icon(Icon::FileToml.into()),
]
.into_iter()
.map(From::from)
.collect()
}
pub fn static_read_notification_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {
vec![
ListDetailsEntry::new("mikaylamaki added you as a contact.")
.actions(vec![Button::new("Decline"), Button::new("Accept")]),
ListDetailsEntry::new("maxdeviant invited you to a stream in #design.")
.seen(true)
.meta("This stream has ended."),
ListDetailsEntry::new("nathansobo accepted your contact request."),
]
.into_iter()
.map(From::from)
.collect()
}
pub fn static_project_panel_project_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {
vec![
ListEntry::new(Label::new("zed"))