compiled and working sidebar in ratatui
This commit is contained in:
@@ -4,9 +4,11 @@ pub mod preview_card;
|
||||
pub mod command_line;
|
||||
pub mod status_line;
|
||||
pub mod canvas;
|
||||
pub mod sidebar;
|
||||
|
||||
pub use command_line::render_command_line;
|
||||
pub use form::*;
|
||||
pub use preview_card::render_preview_card;
|
||||
pub use status_line::render_status_line;
|
||||
pub use canvas::*;
|
||||
pub use sidebar::*;
|
||||
|
||||
29
client/src/components/handlers/sidebar.rs
Normal file
29
client/src/components/handlers/sidebar.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
// src/components/handlers/sidebar.rs
|
||||
use ratatui::{
|
||||
widgets::{Block, Borders, List, ListItem},
|
||||
layout::Rect,
|
||||
style::Style,
|
||||
text::Text,
|
||||
Frame,
|
||||
};
|
||||
use crate::config::colors::Theme;
|
||||
|
||||
pub fn render_sidebar(f: &mut Frame, area: Rect, theme: &Theme) {
|
||||
let sidebar_block = Block::default()
|
||||
.borders(Borders::RIGHT)
|
||||
.border_style(Style::default().fg(theme.border))
|
||||
.style(Style::default().bg(theme.bg));
|
||||
|
||||
let items = vec![
|
||||
ListItem::new(Text::from(" Navigation ")),
|
||||
ListItem::new(Text::from(" Search ")),
|
||||
ListItem::new(Text::from(" Settings ")),
|
||||
];
|
||||
|
||||
let list = List::new(items)
|
||||
.block(sidebar_block)
|
||||
.highlight_style(Style::default().fg(theme.highlight))
|
||||
.highlight_symbol(">>");
|
||||
|
||||
f.render_widget(list, area);
|
||||
}
|
||||
Reference in New Issue
Block a user