Skip to content

Commit

Permalink
better UI for no playback on lyrics page
Browse files Browse the repository at this point in the history
  • Loading branch information
aome510 committed Dec 17, 2024
1 parent fc77299 commit 54b3483
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spotify_player/src/ui/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,18 @@ pub fn render_lyrics_page(
rect: Rect,
) {
// 1. Get data
let Some(progress) = state.player.read().playback_progress() else {
frame.render_widget(Paragraph::new("Lyrics not found"), rect);
return;
};
let data = state.data.read();

// 2. Construct the page's layout
let rect = construct_and_render_block("Lyrics", &ui.theme, Borders::ALL, frame, rect);
let chunks = Layout::vertical([Constraint::Length(2), Constraint::Fill(0)]).split(rect);

// 3. Construct the page's widgets
let Some(progress) = state.player.read().playback_progress() else {
frame.render_widget(Paragraph::new("No playback available"), rect);
return;
};

let PageState::Lyrics {
track_uri,
track,
Expand Down

0 comments on commit 54b3483

Please sign in to comment.