Render stories as Views

This commit is contained in:
Marshall Bowers 2023-10-12 16:06:54 -04:00
parent c90d976d7a
commit fc94c4ea40
5 changed files with 140 additions and 61 deletions

View file

@ -329,12 +329,14 @@ mod stories {
workspace: View<Workspace>,
}
pub fn workspace_story(cx: &mut WindowContext) -> View<WorkspaceStory> {
view(
cx.entity(|cx| WorkspaceStory {
workspace: workspace(cx),
}),
|view, cx| view.workspace.clone(),
)
impl WorkspaceStory {
pub fn view(cx: &mut WindowContext) -> View<Self> {
view(
cx.entity(|cx| Self {
workspace: workspace(cx),
}),
|view, cx| view.workspace.clone(),
)
}
}
}