far better, renamed evenhandler to even reader in tui
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
pub mod core;
|
||||
pub mod grpc_client;
|
||||
pub mod commands;
|
||||
pub mod events;
|
||||
pub mod event_reader;
|
||||
|
||||
pub use core::TerminalCore;
|
||||
pub use grpc_client::GrpcClient;
|
||||
pub use commands::CommandHandler;
|
||||
pub use events::EventHandler;
|
||||
pub use event_reader::EventReader;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// src/tui/terminal/events.rs
|
||||
// src/tui/terminal/event_reader.rs
|
||||
|
||||
use crossterm::event::{self, Event};
|
||||
|
||||
pub struct EventHandler;
|
||||
pub struct EventReader;
|
||||
|
||||
impl EventHandler {
|
||||
impl EventReader {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
use crate::tui::terminal::TerminalCore;
|
||||
use crate::tui::terminal::GrpcClient;
|
||||
use crate::tui::terminal::CommandHandler;
|
||||
use crate::tui::terminal::EventReader;
|
||||
use crate::config::colors::Theme;
|
||||
use crate::config::config::Config;
|
||||
use crate::ui::handlers::{form::FormState, render::render_ui};
|
||||
@@ -33,6 +34,7 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// The rest of your UI initialization remains the same
|
||||
let mut event_handler = EventHandler::new();
|
||||
let event_reader = EventReader::new();
|
||||
let mut app_state = AppState::new()?;
|
||||
|
||||
// Fetch the total count of Adresar entries
|
||||
@@ -60,7 +62,7 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
|
||||
);
|
||||
})?;
|
||||
|
||||
let event = event_handler.read_event()?;
|
||||
let event = event_reader.read_event()?;
|
||||
let (should_exit, message) = event_handler.handle_event(
|
||||
event,
|
||||
&config,
|
||||
|
||||
Reference in New Issue
Block a user