Restructure storybook modules and components
Co-Authored-By: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
2774eae21a
commit
917884ffaf
9 changed files with 14 additions and 10 deletions
|
@ -1,2 +0,0 @@
|
||||||
pub(crate) mod icon_button;
|
|
||||||
pub(crate) mod tab;
|
|
|
@ -4,6 +4,12 @@ use gpui2::{
|
||||||
};
|
};
|
||||||
use std::{marker::PhantomData, rc::Rc};
|
use std::{marker::PhantomData, rc::Rc};
|
||||||
|
|
||||||
|
mod icon_button;
|
||||||
|
mod tab;
|
||||||
|
|
||||||
|
pub(crate) use icon_button::{icon_button, ButtonVariant};
|
||||||
|
pub(crate) use tab::tab;
|
||||||
|
|
||||||
struct ButtonHandlers<V, D> {
|
struct ButtonHandlers<V, D> {
|
||||||
click: Option<Rc<dyn Fn(&mut V, &D, &mut EventContext<V>)>>,
|
click: Option<Rc<dyn Fn(&mut V, &D, &mut EventContext<V>)>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ use gpui2::{elements::div, IntoElement};
|
||||||
use gpui2::{Element, ParentElement, ViewContext};
|
use gpui2::{Element, ParentElement, ViewContext};
|
||||||
|
|
||||||
#[derive(Element)]
|
#[derive(Element)]
|
||||||
struct IconButton {
|
pub(crate) struct IconButton {
|
||||||
path: &'static str,
|
path: &'static str,
|
||||||
variant: ButtonVariant,
|
variant: ButtonVariant,
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ use gpui2::{elements::div, IntoElement};
|
||||||
use gpui2::{Element, ParentElement, ViewContext};
|
use gpui2::{Element, ParentElement, ViewContext};
|
||||||
|
|
||||||
#[derive(Element)]
|
#[derive(Element)]
|
||||||
struct Tab {
|
pub(crate) struct Tab {
|
||||||
title: &'static str,
|
title: &'static str,
|
||||||
active: bool,
|
active: bool,
|
||||||
}
|
}
|
|
@ -1 +0,0 @@
|
||||||
pub(crate) mod tab_bar;
|
|
3
crates/storybook/src/modules.rs
Normal file
3
crates/storybook/src/modules.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
mod tab_bar;
|
||||||
|
|
||||||
|
pub(crate) use tab_bar::tab_bar;
|
|
@ -1,7 +1,6 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use crate::component::icon_button::{icon_button, ButtonVariant};
|
use crate::components::{icon_button, tab, ButtonVariant};
|
||||||
use crate::component::tab::tab;
|
|
||||||
use crate::theme::theme;
|
use crate::theme::theme;
|
||||||
use gpui2::elements::div::ScrollState;
|
use gpui2::elements::div::ScrollState;
|
||||||
use gpui2::style::StyleHelpers;
|
use gpui2::style::StyleHelpers;
|
|
@ -10,10 +10,9 @@ use settings::{default_settings, SettingsStore};
|
||||||
use simplelog::SimpleLogger;
|
use simplelog::SimpleLogger;
|
||||||
|
|
||||||
mod collab_panel;
|
mod collab_panel;
|
||||||
mod component;
|
|
||||||
mod components;
|
mod components;
|
||||||
mod element_ext;
|
mod element_ext;
|
||||||
mod module;
|
mod modules;
|
||||||
mod theme;
|
mod theme;
|
||||||
mod workspace;
|
mod workspace;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{collab_panel::collab_panel, module::tab_bar::tab_bar, theme::theme};
|
use crate::{collab_panel::collab_panel, modules::tab_bar, theme::theme};
|
||||||
use gpui2::{
|
use gpui2::{
|
||||||
elements::{div, div::ScrollState, img, svg},
|
elements::{div, div::ScrollState, img, svg},
|
||||||
style::{StyleHelpers, Styleable},
|
style::{StyleHelpers, Styleable},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue