storybook: Fix kitchen sink story (#3064)

This PR fixes the kitchen sink story in the storybook.

Included are some additional changes that make it so the kitchen sink is
automatically populated by all of the defined stories.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-09-28 21:22:50 -04:00 committed by GitHub
parent f26ca0866c
commit 247c7eff14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 81 deletions

View file

@ -70,33 +70,11 @@ fn main() {
..Default::default()
},
|cx| match args.story {
// HACK: Special-case the kitchen sink to fix scrolling.
// There is something about going through `children_any` that messes
// with the scroll interactions.
Some(StorySelector::KitchenSink) => view(move |cx| {
render_story(
&mut ViewContext::new(cx),
theme_override.clone(),
crate::stories::kitchen_sink::KitchenSinkStory::default(),
)
}),
// HACK: Special-case the panel story to fix scrolling.
// There is something about going through `children_any` that messes
// with the scroll interactions.
Some(StorySelector::Component(story_selector::ComponentStory::Panel)) => {
view(move |cx| {
render_story(
&mut ViewContext::new(cx),
theme_override.clone(),
crate::stories::components::panel::PanelStory::default(),
)
})
}
Some(selector) => view(move |cx| {
render_story(
&mut ViewContext::new(cx),
theme_override.clone(),
div().children_any(selector.story()),
div().flex().flex_col().h_full().child_any(selector.story()),
)
}),
None => view(move |cx| {