Skip to content

Commit

Permalink
feat(term): add nerd font to feed detail component
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Mar 17, 2024
1 parent a8ee97d commit 1379a29
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions crates/synd_term/src/ui/components/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl Subscription {
(header, constraints, self.feeds.iter().map(row))
}

#[allow(clippy::too_many_lines)]
fn render_feed_detail(&self, area: Rect, buf: &mut Buffer, cx: &Context<'_>) {
let block = Block::new()
.padding(Padding {
Expand Down Expand Up @@ -216,11 +217,17 @@ impl Subscription {
let meta = {
let meta = vec![
Line::from(vec![
Span::styled("Feed Src ", Style::default().add_modifier(Modifier::BOLD)),
Span::styled(
"󰗀 Feed Src ",
Style::default().add_modifier(Modifier::BOLD),
),
Span::from(feed.url.as_str()),
]),
Line::from(vec![
Span::styled("Feed type ", Style::default().add_modifier(Modifier::BOLD)),
Span::styled(
"󰈙 Feed type ",
Style::default().add_modifier(Modifier::BOLD),
),
Span::from(match feed.r#type {
Some(FeedType::RSS0) => "RSS 0",
Some(FeedType::RSS1) => "RSS 1",
Expand All @@ -231,15 +238,21 @@ impl Subscription {
}),
]),
Line::from(vec![
Span::styled("Authors ", Style::default().add_modifier(Modifier::BOLD)),
Span::styled(
"󰚼 Authors ",
Style::default().add_modifier(Modifier::BOLD),
),
Span::from(if feed.authors.is_empty() {
Cow::Borrowed(ui::UNKNOWN_SYMBOL)
} else {
Cow::Owned(feed.authors.iter().join(", "))
}),
]),
Line::from(vec![
Span::styled("Generator ", Style::default().add_modifier(Modifier::BOLD)),
Span::styled(
" Generator ",
Style::default().add_modifier(Modifier::BOLD),
),
Span::from(feed.generator.as_deref().unwrap_or(ui::UNKNOWN_SYMBOL)),
]),
];
Expand Down Expand Up @@ -272,9 +285,9 @@ impl Subscription {
};

let header = Row::new([
Cell::new(Span::from("Published")),
Cell::new(Span::from("Entry")),
Cell::new(Span::from("Summary")),
Cell::new(Span::from("󰈙 Published")),
Cell::new(Span::from("󰯂 Entry")),
Cell::new(Span::from("󱙓 Summary")),
]);

let widths = [
Expand Down

0 comments on commit 1379a29

Please sign in to comment.