project structure redesign
This commit is contained in:
@@ -5,7 +5,7 @@ use ratatui::{
|
||||
layout::Rect,
|
||||
Frame,
|
||||
};
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
|
||||
pub fn render_command_line(f: &mut Frame, area: Rect, input: &str, active: bool, theme: &Theme, message: &str) {
|
||||
let prompt = if active {
|
||||
|
||||
@@ -6,7 +6,7 @@ use ratatui::{
|
||||
text::{Line, Span},
|
||||
Frame,
|
||||
};
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
use crate::ui::form::FormState;
|
||||
|
||||
pub fn render_form(
|
||||
|
||||
@@ -6,7 +6,7 @@ use ratatui::{
|
||||
text::Text,
|
||||
Frame,
|
||||
};
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
|
||||
pub fn render_preview_card(f: &mut Frame, area: Rect, fields: &[&String], theme: &Theme) {
|
||||
let card = Block::default()
|
||||
|
||||
@@ -6,7 +6,7 @@ use ratatui::{
|
||||
Frame,
|
||||
text::{Line, Span},
|
||||
};
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
use std::path::Path;
|
||||
|
||||
pub fn render_status_line(
|
||||
|
||||
3
client/src/config/mod.rs
Normal file
3
client/src/config/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
// src/config/mod.rs
|
||||
pub mod colors;
|
||||
pub mod config;
|
||||
@@ -1,8 +1,7 @@
|
||||
// client/src/lib.rs
|
||||
pub mod config;
|
||||
pub mod terminal;
|
||||
pub mod ui;
|
||||
pub mod colors;
|
||||
pub mod tui;
|
||||
pub mod config;
|
||||
pub mod components1;
|
||||
|
||||
pub use ui::run_ui;
|
||||
|
||||
2
client/src/tui/mod.rs
Normal file
2
client/src/tui/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
// src/tui/mod.rs
|
||||
pub mod terminal;
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
use crossterm::event::{Event, KeyCode, KeyModifiers};
|
||||
use crossterm::cursor::{SetCursorStyle};
|
||||
use crate::terminal::AppTerminal;
|
||||
use crate::config::Config;
|
||||
use crate::tui::terminal::AppTerminal;
|
||||
use crate::config::config::Config;
|
||||
use common::proto::multieko2::adresar::{PostAdresarRequest, PutAdresarRequest};
|
||||
use super::form::FormState;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/client/ui/handlers/form.rs
|
||||
|
||||
use crate::components1::render_form;
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
use ratatui::layout::Rect;
|
||||
use ratatui::Frame;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/client/ui/handlers/render.rs
|
||||
|
||||
use crate::components1::{render_command_line, render_preview_card, render_status_line};
|
||||
use crate::colors::Theme;
|
||||
use crate::config::colors::Theme;
|
||||
use ratatui::layout::{Constraint, Direction, Layout};
|
||||
use ratatui::Frame;
|
||||
use super::form::FormState;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// src/client/ui/handlers/ui.rs
|
||||
|
||||
use crate::terminal::AppTerminal;
|
||||
use crate::colors::Theme;
|
||||
use crate::config::Config;
|
||||
use crate::tui::terminal::AppTerminal;
|
||||
use crate::config::colors::Theme;
|
||||
use crate::config::config::Config;
|
||||
use crate::ui::handlers::{event::EventHandler, form::FormState, state::AppState, render::render_ui};
|
||||
|
||||
pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
Reference in New Issue
Block a user