Checkpoint
This commit is contained in:
parent
207d843aee
commit
262f5886a4
44 changed files with 237 additions and 148 deletions
|
@ -18,9 +18,9 @@ impl<S: 'static + Send + Sync + Clone> KitchenSinkStory<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
let element_stories = ElementStory::iter().map(|selector| selector.story());
|
||||
let component_stories = ComponentStory::iter().map(|selector| selector.story());
|
||||
let component_stories = ComponentStory::iter().map(|selector| selector.story(cx));
|
||||
|
||||
Story::container(cx)
|
||||
.overflow_y_scroll(ScrollState::default())
|
||||
|
|
|
@ -19,7 +19,7 @@ impl<S: 'static + Send + Sync> ZIndexStory<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title(cx, "z-index"))
|
||||
.child(
|
||||
|
@ -103,7 +103,7 @@ impl<S: 'static + Send + Sync> ZIndexExample<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
div()
|
||||
.relative()
|
||||
.size_full()
|
||||
|
|
|
@ -65,7 +65,7 @@ pub enum ComponentStory {
|
|||
}
|
||||
|
||||
impl ComponentStory {
|
||||
pub fn story<S: 'static + Send + Sync + Clone>(&self) -> AnyElement<S> {
|
||||
pub fn story<S: 'static + Send + Sync + Clone>(&self, cx: &mut WindowContext) -> AnyElement<S> {
|
||||
match self {
|
||||
Self::AssistantPanel => ui::AssistantPanelStory::new().into_any(),
|
||||
Self::Buffer => ui::BufferStory::new().into_any(),
|
||||
|
@ -90,7 +90,7 @@ impl ComponentStory {
|
|||
Self::Toast => ui::ToastStory::new().into_any(),
|
||||
Self::Toolbar => ui::ToolbarStory::new().into_any(),
|
||||
Self::TrafficLights => ui::TrafficLightsStory::new().into_any(),
|
||||
Self::Workspace => ui::WorkspaceStory::new().into_any(),
|
||||
Self::Workspace => ui::workspace_story(cx).into_any().into_any(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,10 +131,10 @@ impl FromStr for StorySelector {
|
|||
}
|
||||
|
||||
impl StorySelector {
|
||||
pub fn story<S: 'static + Send + Sync + Clone>(&self) -> AnyElement<S> {
|
||||
pub fn story<S: 'static + Send + Sync + Clone>(&self, cx: &mut WindowContext) -> AnyElement<S> {
|
||||
match self {
|
||||
Self::Element(element_story) => element_story.story(),
|
||||
Self::Component(component_story) => component_story.story(),
|
||||
Self::Component(component_story) => component_story.story(cx),
|
||||
Self::KitchenSink => crate::stories::kitchen_sink::KitchenSinkStory::new().into_any(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue