Skip to content

Commit

Permalink
chore(tui): Dim pane text helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew committed Nov 29, 2024
1 parent 02f8656 commit 4e7a695
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/turborepo-ui/src/tui/pane.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ratatui::{
style::Style,
style::{Modifier, Style},
text::Line,
widgets::{Block, Widget},
};
Expand Down Expand Up @@ -39,7 +39,7 @@ impl<'a, W> TerminalPane<'a, W> {
}

fn footer(&self) -> Line {
let build_message_vec = |footer_text: &str| -> String {
let build_message_vec = |footer_text: &str| -> Line {
let mut messages = vec![footer_text];

if !self.has_sidebar {
Expand All @@ -51,18 +51,18 @@ impl<'a, W> TerminalPane<'a, W> {
}

// Spaces are used to pad the footer text for aesthetics
format!(" {}", messages.join(", "))
let formatted_messages = format!(" {}", messages.join(", "));

Line::styled(
formatted_messages.to_string(),
Style::default().add_modifier(Modifier::DIM),
)
.left_aligned()
};

match self.section {
LayoutSections::Pane => {
let messages = build_message_vec(FOOTER_TEXT_ACTIVE);
Line::from(messages).left_aligned()
}
LayoutSections::TaskList => {
let messages = build_message_vec(FOOTER_TEXT_INACTIVE);
Line::from(messages).left_aligned()
}
LayoutSections::Pane => build_message_vec(FOOTER_TEXT_ACTIVE),
LayoutSections::TaskList => build_message_vec(FOOTER_TEXT_INACTIVE),
LayoutSections::Search { results, .. } => {
Line::from(format!("/ {}", results.query())).left_aligned()
}
Expand Down

0 comments on commit 4e7a695

Please sign in to comment.