register form now has optional field role

This commit is contained in:
filipriec
2025-04-11 13:51:05 +02:00
parent 0fd2a589eb
commit cf1aa4fd2a
4 changed files with 26 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ pub fn render_register(
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(6), // Form (4 fields + padding)
Constraint::Length(7), // Form (5 fields + padding)
Constraint::Length(1), // Error message
Constraint::Length(3), // Buttons
])
@@ -55,6 +55,7 @@ pub fn render_register(
"Email (Optional)",
"Password (Optional)",
"Confirm Password",
"Role (Optional)",
],
&state.current_field,
&[ // Update values from RegisterState
@@ -62,6 +63,7 @@ pub fn render_register(
&state.email,
&state.password,
&state.password_confirmation,
&state.role,
],
theme,
is_edit_mode,