changing components infrastructure

This commit is contained in:
filipriec
2025-03-22 15:36:49 +01:00
parent 9bf1d065d5
commit fabe1e0ca7
9 changed files with 17 additions and 6 deletions

View File

@@ -0,0 +1,4 @@
// src/components/admin_panel.rs
pub mod admin_panel;
pub use admin_panel::*;

View File

@@ -5,7 +5,6 @@ pub mod status_line;
pub mod canvas;
pub mod sidebar;
pub mod background;
pub mod intro;
pub mod admin_panel;
pub use command_line::render_command_line;
@@ -14,5 +13,4 @@ pub use status_line::render_status_line;
pub use canvas::*;
pub use sidebar::*;
pub use background::*;
pub use intro::*;
pub use admin_panel::*;

View File

@@ -0,0 +1,4 @@
// src/components/intro.rs
pub mod intro;
pub use intro::*;

View File

@@ -1,5 +1,8 @@
// src/components/mod.rs
pub mod models;
pub mod handlers;
pub mod intro;
pub mod admin_panel;
pub use handlers::*;
pub use intro::*;
pub use admin_panel::*;

View File

@@ -47,7 +47,7 @@ impl EventHandler {
app_state: &mut crate::state::state::AppState,
total_count: u64,
current_position: &mut u64,
intro_state: &mut crate::components::handlers::intro::IntroState,
intro_state: &mut crate::components::intro::intro::IntroState,
) -> Result<(bool, String), Box<dyn std::error::Error>> {
if app_state.ui.show_intro {
if let Event::Key(key) = event {

View File

@@ -4,7 +4,8 @@ use crate::components::{
render_background,
render_command_line,
render_status_line,
handlers::{sidebar::{self, calculate_sidebar_layout}, intro, admin_panel::AdminPanelState, form::render_form},
handlers::{sidebar::{self, calculate_sidebar_layout}, admin_panel::AdminPanelState, form::render_form},
intro::{intro},
};
use crate::config::colors::Theme;
use ratatui::layout::{Constraint, Direction, Layout};

View File

@@ -9,7 +9,8 @@ use crate::config::config::Config;
use crate::ui::handlers::{form::FormState, render::render_ui};
use crate::modes::handlers::event::EventHandler;
use crate::state::state::AppState;
use crate::components::handlers::{intro::IntroState, admin_panel::AdminPanelState};
use crate::components::handlers::{admin_panel::AdminPanelState};
use crate::components::intro::{intro::IntroState};
pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::load()?;