Fixed a UI bug that briefly showed "No movies found" error before actually loading content

This commit is contained in:
2023-08-08 10:50:05 -06:00
parent 316c129b99
commit fa381cea01
2 changed files with 19 additions and 7 deletions
+8
View File
@@ -93,6 +93,14 @@ pub fn layout_paragraph_borderless(string: &str) -> Paragraph {
.alignment(Alignment::Center)
}
pub fn layout_error_paragraph(string: &str) -> Paragraph {
Paragraph::new(Text::from(string))
.block(layout_block_with_title(title_style("Error")))
.style(style_failure().add_modifier(Modifier::BOLD))
.wrap(Wrap { trim: false })
.alignment(Alignment::Center)
}
pub fn borderless_block<'a>() -> Block<'a> {
Block::default()
}