refactor(ui): Simplified the popup delegation so all future UI is easier to implement
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::ui::utils::layout_block_top_border;
|
||||
use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
use crate::ui::widgets::popup::{Popup, Size};
|
||||
use crate::ui::{draw_input_box_popup, draw_popup_over, DrawUi};
|
||||
use crate::ui::{draw_input_box_popup, draw_popup, DrawUi};
|
||||
use crate::utils::convert_to_gb;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -31,13 +31,12 @@ impl DrawUi for RootFoldersUi {
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_root_folders(f, app, area);
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::RootFolders => draw_root_folders(f, app, area),
|
||||
ActiveSonarrBlock::AddRootFolderPrompt => draw_popup_over(
|
||||
ActiveSonarrBlock::AddRootFolderPrompt => draw_popup(
|
||||
f,
|
||||
app,
|
||||
area,
|
||||
draw_root_folders,
|
||||
draw_add_root_folder_prompt_box,
|
||||
Size::InputBox,
|
||||
),
|
||||
@@ -51,7 +50,6 @@ impl DrawUi for RootFoldersUi {
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.sonarr_data.prompt_confirm);
|
||||
|
||||
draw_root_folders(f, app, area);
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
|
||||
Reference in New Issue
Block a user