refactor(ui): Simplified the popup delegation so all future UI is easier to implement
This commit is contained in:
@@ -32,12 +32,10 @@ impl DrawUi for BlocklistUi {
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_blocklist_table(f, app, area);
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::Blocklist | ActiveSonarrBlock::BlocklistSortPrompt => {
|
||||
draw_blocklist_table(f, app, area)
|
||||
}
|
||||
ActiveSonarrBlock::BlocklistItemDetails => {
|
||||
draw_blocklist_table(f, app, area);
|
||||
draw_blocklist_item_details_popup(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::DeleteBlocklistItemPrompt => {
|
||||
@@ -55,7 +53,6 @@ impl DrawUi for BlocklistUi {
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.sonarr_data.prompt_confirm);
|
||||
|
||||
draw_blocklist_table(f, app, area);
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
@@ -67,7 +64,6 @@ impl DrawUi for BlocklistUi {
|
||||
.prompt("Do you want to clear your blocklist?")
|
||||
.yes_no_value(app.data.sonarr_data.prompt_confirm);
|
||||
|
||||
draw_blocklist_table(f, app, area);
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::SmallPrompt),
|
||||
f.area(),
|
||||
|
||||
Reference in New Issue
Block a user