adjusted login not working yet, wrong changes
This commit is contained in:
@@ -5,12 +5,11 @@ use crate::{
|
||||
state::pages::auth::AuthState,
|
||||
};
|
||||
use ratatui::{
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect, Margin},
|
||||
style::{Color, Style},
|
||||
widgets::{Block, BorderType, Borders, Paragraph},
|
||||
Frame,
|
||||
};
|
||||
use ratatui::prelude::Margin;
|
||||
|
||||
pub fn render_login(
|
||||
f: &mut Frame,
|
||||
@@ -18,11 +17,11 @@ pub fn render_login(
|
||||
theme: &Theme,
|
||||
state: &AuthState,
|
||||
) {
|
||||
// Main login block with rounded borders
|
||||
// Main login block with plain borders (matches main form style)
|
||||
let block = Block::default()
|
||||
.borders(Borders::ALL)
|
||||
.border_type(BorderType::Rounded)
|
||||
.border_style(Style::default().fg(theme.accent))
|
||||
.border_type(BorderType::Plain) // Matches main form style
|
||||
.border_style(Style::default().fg(theme.border))
|
||||
.title(" Login ")
|
||||
.style(Style::default().bg(theme.bg));
|
||||
|
||||
@@ -40,12 +39,13 @@ pub fn render_login(
|
||||
let chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints([
|
||||
Constraint::Min(3), // Form area (will be managed by render_generic_form)
|
||||
Constraint::Min(3), // Form area
|
||||
Constraint::Length(1), // Error message area
|
||||
Constraint::Length(3), // Buttons area
|
||||
])
|
||||
.split(inner_area);
|
||||
|
||||
// Render form using generic component
|
||||
// Render form with plaintext display
|
||||
render_generic_form(
|
||||
f,
|
||||
chunks[0],
|
||||
@@ -60,7 +60,7 @@ pub fn render_login(
|
||||
let button_chunks = Layout::default()
|
||||
.direction(Direction::Horizontal)
|
||||
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)])
|
||||
.split(chunks[1]);
|
||||
.split(chunks[2]);
|
||||
|
||||
// Login button
|
||||
let login_style = if !state.return_selected {
|
||||
@@ -121,6 +121,6 @@ pub fn render_login(
|
||||
let err_block = Paragraph::new(err.as_str())
|
||||
.style(Style::default().fg(Color::Red))
|
||||
.alignment(Alignment::Center);
|
||||
f.render_widget(err_block, chunks[0]); // Render over form area
|
||||
f.render_widget(err_block, chunks[1]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user