Add Terminal
component
This commit is contained in:
parent
8db7f7ed37
commit
82577b4acc
6 changed files with 161 additions and 52 deletions
|
@ -3,4 +3,5 @@ pub mod buffer;
|
|||
pub mod panel;
|
||||
pub mod project_panel;
|
||||
pub mod tab;
|
||||
pub mod terminal;
|
||||
pub mod workspace;
|
||||
|
|
26
crates/storybook2/src/stories/components/terminal.rs
Normal file
26
crates/storybook2/src/stories/components/terminal.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use ui::prelude::*;
|
||||
use ui::Terminal;
|
||||
|
||||
use crate::story::Story;
|
||||
|
||||
#[derive(Element)]
|
||||
pub struct TerminalStory<S: 'static + Send + Sync + Clone> {
|
||||
state_type: PhantomData<S>,
|
||||
}
|
||||
|
||||
impl<S: 'static + Send + Sync + Clone> TerminalStory<S> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
state_type: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<S>) -> impl Element<State = S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Terminal<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
.child(Terminal::new())
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ pub enum ComponentStory {
|
|||
Panel,
|
||||
ProjectPanel,
|
||||
Tab,
|
||||
Terminal,
|
||||
Workspace,
|
||||
}
|
||||
|
||||
|
@ -54,6 +55,7 @@ impl ComponentStory {
|
|||
Self::Panel => components::panel::PanelStory::new().into_any(),
|
||||
Self::ProjectPanel => components::project_panel::ProjectPanelStory::new().into_any(),
|
||||
Self::Tab => components::tab::TabStory::new().into_any(),
|
||||
Self::Terminal => components::terminal::TerminalStory::new().into_any(),
|
||||
Self::Workspace => components::workspace::WorkspaceStory::new().into_any(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue