Extract Story
into separate story
crate (#3378)
This PR extracts the `Story` component into a separate `story` crate so that it can be shared among various crates that define stories. Release Notes: - N/A --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This commit is contained in:
parent
f4b4bdfd83
commit
1b05aad30c
26 changed files with 309 additions and 316 deletions
|
@ -1,8 +1,9 @@
|
|||
use gpui::{Div, Render};
|
||||
use story::Story;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{Icon, IconElement, Story};
|
||||
use crate::{Icon, IconElement};
|
||||
|
||||
pub struct IconStory;
|
||||
|
||||
|
@ -12,9 +13,9 @@ impl Render for IconStory {
|
|||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||
let icons = Icon::iter();
|
||||
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<IconElement>(cx))
|
||||
.child(Story::label(cx, "All Icons"))
|
||||
Story::container()
|
||||
.child(Story::title_for::<IconElement>())
|
||||
.child(Story::label("All Icons"))
|
||||
.child(div().flex().gap_3().children(icons.map(IconElement::new)))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue