-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b882835
commit dd9a0e1
Showing
4 changed files
with
0 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +0,0 @@ | ||
use gpui::Render; | ||
use story::{Story, StoryItem, StorySection}; | ||
|
||
use crate::{prelude::*, AudioStatus, CollaboratorAvailability, AvatarAvailabilityIndicator}; | ||
use crate::{Avatar, AvatarAudioStatusIndicator}; | ||
|
||
pub struct AvatarStory; | ||
|
||
impl Render for AvatarStory { | ||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { | ||
Story::container() | ||
.child(Story::title_for::<Avatar>()) | ||
.child( | ||
StorySection::new() | ||
.child(StoryItem::new( | ||
"Default", | ||
Avatar::new("https://avatars.githubusercontent.com/u/1714999?v=4"), | ||
)) | ||
.child(StoryItem::new( | ||
"Default", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4"), | ||
)), | ||
) | ||
.child( | ||
StorySection::new() | ||
.child(StoryItem::new( | ||
"With free availability indicator", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.indicator(AvatarAvailabilityIndicator::new(CollaboratorAvailability::Free)), | ||
)) | ||
.child(StoryItem::new( | ||
"With busy availability indicator", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.indicator(AvatarAvailabilityIndicator::new(CollaboratorAvailability::Busy)), | ||
)), | ||
) | ||
.child( | ||
StorySection::new() | ||
.child(StoryItem::new( | ||
"With info border", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.border_color(cx.theme().status().info_border), | ||
)) | ||
.child(StoryItem::new( | ||
"With error border", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.border_color(cx.theme().status().error_border), | ||
)), | ||
) | ||
.child( | ||
StorySection::new() | ||
.child(StoryItem::new( | ||
"With muted audio indicator", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.indicator(AvatarAudioStatusIndicator::new(AudioStatus::Muted)), | ||
)) | ||
.child(StoryItem::new( | ||
"With deafened audio indicator", | ||
Avatar::new("https://avatars.githubusercontent.com/u/326587?v=4") | ||
.indicator(AvatarAudioStatusIndicator::new(AudioStatus::Deafened)), | ||
)), | ||
) | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +0,0 @@ | ||
use gpui::Render; | ||
use story::Story; | ||
|
||
use crate::{prelude::*, IconName}; | ||
use crate::{Button, ButtonStyle}; | ||
|
||
pub struct ButtonStory; | ||
|
||
impl Render for ButtonStory { | ||
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement { | ||
Story::container() | ||
.child(Story::title_for::<Button>()) | ||
.child(Story::label("Default")) | ||
.child(Button::new("default_filled", "Click me")) | ||
.child(Story::label("Selected")) | ||
.child(Button::new("selected_filled", "Click me").toggle_state(true)) | ||
.child(Story::label("Selected with `selected_label`")) | ||
.child( | ||
Button::new("selected_label_filled", "Click me") | ||
.toggle_state(true) | ||
.selected_label("I have been selected"), | ||
) | ||
.child(Story::label("With `label_color`")) | ||
.child(Button::new("filled_with_label_color", "Click me").color(Color::Created)) | ||
.child(Story::label("With `icon`")) | ||
.child(Button::new("filled_with_icon", "Click me").icon(IconName::FileGit)) | ||
.child(Story::label("Selected with `icon`")) | ||
.child( | ||
Button::new("filled_and_selected_with_icon", "Click me") | ||
.toggle_state(true) | ||
.icon(IconName::FileGit), | ||
) | ||
.child(Story::label("Default (Subtle)")) | ||
.child(Button::new("default_subtle", "Click me").style(ButtonStyle::Subtle)) | ||
.child(Story::label("Default (Transparent)")) | ||
.child(Button::new("default_transparent", "Click me").style(ButtonStyle::Transparent)) | ||
} | ||
} | ||