Adding description to the header
This commit is contained in:
parent
44a1c2055e
commit
bb57f3264e
2 changed files with 7 additions and 10 deletions
|
|
@ -14,10 +14,17 @@ pub fn render_header(frame: &mut Frame, area: Rect, state: &DashboardViewState)
|
|||
} else {
|
||||
format!("{} - {}", t("dashboard-header"), state.title)
|
||||
};
|
||||
let description = state
|
||||
.descriptions
|
||||
.as_ref()
|
||||
.filter(|s| !s.trim().is_empty())
|
||||
.map(|s| format!(" - {}", s))
|
||||
.unwrap_or("".to_string());
|
||||
|
||||
let header = Paragraph::new(Line::from(vec![
|
||||
Span::styled("📈 ", Style::default().fg(Color::Cyan)),
|
||||
Span::styled(title, Style::default().fg(Color::White).bold()),
|
||||
Span::styled(description, Style::default().fg(Color::White).bold()),
|
||||
]))
|
||||
.alignment(Alignment::Center)
|
||||
.block(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue