Fix issues in storybook2

This commit is contained in:
Marshall Bowers 2023-10-12 10:44:18 -04:00
parent a6b872bb0c
commit 207d843aee
4 changed files with 7 additions and 7 deletions

View file

@ -1,8 +1,8 @@
use crate::theme::{theme, Theme};
use gpui3::{ use gpui3::{
div, svg, view, AppContext, Context, Element, ElementId, IntoAnyElement, ParentElement, div, svg, view, AppContext, Context, Element, ElementId, IntoAnyElement, ParentElement,
ScrollState, SharedString, StyleHelpers, Styled, View, ViewContext, WindowContext, ScrollState, SharedString, StyleHelpers, Styled, View, ViewContext, WindowContext,
}; };
use ui::{theme, Theme};
pub struct CollabPanel { pub struct CollabPanel {
scroll_state: ScrollState, scroll_state: ScrollState,
@ -68,21 +68,21 @@ impl CollabPanel {
.py_2() .py_2()
.flex() .flex()
.flex_col() .flex_col()
.child(self.list_section_header(1, "CHANNELS", true, theme)), .child(self.list_section_header(1, "CHANNELS", true, &theme)),
) )
.child( .child(
div() div()
.py_2() .py_2()
.flex() .flex()
.flex_col() .flex_col()
.child(self.list_section_header(2, "CONTACTS", true, theme)) .child(self.list_section_header(2, "CONTACTS", true, &theme))
.children( .children(
std::iter::repeat_with(|| { std::iter::repeat_with(|| {
vec![ vec![
self.list_item( self.list_item(
"http://github.com/as-cii.png?s=50", "http://github.com/as-cii.png?s=50",
"as-cii", "as-cii",
theme, &theme,
), ),
// self.list_item( // self.list_item(
// "http://github.com/nathansobo.png?s=50", // "http://github.com/nathansobo.png?s=50",

View file

@ -87,7 +87,7 @@ trait Styles: StyleHelpers {
} }
} }
impl<S> Styles for Div<S> {} impl<S: 'static + Send + Sync> Styles for Div<S> {}
#[derive(Element)] #[derive(Element)]
struct ZIndexExample<S: 'static + Send + Sync> { struct ZIndexExample<S: 'static + Send + Sync> {

View file

@ -102,7 +102,7 @@ impl StoryWrapper {
Self { selector, theme } Self { selector, theme }
} }
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<State = Self> { fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
themed(self.theme.clone(), cx, |cx| { themed(self.theme.clone(), cx, |cx| {
div() div()
.flex() .flex()

View file

@ -1,12 +1,12 @@
use crate::{ use crate::{
collab_panel::{collab_panel, CollabPanel}, collab_panel::{collab_panel, CollabPanel},
theme::{theme, themed},
themes::rose_pine, themes::rose_pine,
}; };
use gpui3::{ use gpui3::{
div, img, svg, view, Context, Element, ParentElement, RootView, StyleHelpers, Styled, View, div, img, svg, view, Context, Element, ParentElement, RootView, StyleHelpers, Styled, View,
ViewContext, WindowContext, ViewContext, WindowContext,
}; };
use ui::{theme, themed};
pub struct Workspace { pub struct Workspace {
left_panel: View<CollabPanel, Self>, left_panel: View<CollabPanel, Self>,