register 2

This commit is contained in:
filipriec
2025-04-10 19:27:04 +02:00
parent b51e76e366
commit 431882ece9
4 changed files with 54 additions and 11 deletions

View File

@@ -14,12 +14,14 @@ use ratatui::layout::{Constraint, Direction, Layout};
use ratatui::Frame;
use crate::state::pages::form::FormState;
use crate::state::pages::auth::AuthState;
use crate::state::pages::auth::RegisterState;
use crate::state::state::AppState;
pub fn render_ui(
f: &mut Frame,
form_state: &mut FormState,
auth_state: &mut AuthState,
register_state: &RegisterState,
theme: &Theme,
is_edit_mode: bool,
total_count: u64,
@@ -43,8 +45,16 @@ pub fn render_ui(
let main_content_area = root[0];
if app_state.ui.show_intro {
// Use app_state's intro_state directly
app_state.ui.intro_state.render(f, main_content_area, theme);
} else if app_state.ui.show_register {
render_register(
f,
main_content_area,
theme,
register_state,
app_state,
register_state.current_field < 4
);
}else if app_state.ui.show_login {
render_login(
f,

View File

@@ -52,9 +52,10 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
render_ui(
f,
&mut form_state,
&mut auth_state, // Pass the single AuthState instance
&mut auth_state,
&register_state,
&theme,
is_edit_mode, // Use determined edit mode
is_edit_mode,
app_state.total_count,
app_state.current_position,
&app_state.current_dir,