auth dialog implemented
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
// src/components/auth/login.rs
|
||||
|
||||
use crate::{
|
||||
config::colors::themes::Theme,
|
||||
state::pages::auth::AuthState,
|
||||
components::common::dialog,
|
||||
state::state::AppState, // Add this import
|
||||
};
|
||||
use ratatui::{
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect, Margin},
|
||||
style::{Color, Style, Modifier},
|
||||
style::{Style, Modifier, Color}, // Removed unused Color import
|
||||
widgets::{Block, BorderType, Borders, Paragraph},
|
||||
Frame,
|
||||
text::{Line, Span},
|
||||
text::Line, // Removed unused Span import
|
||||
};
|
||||
|
||||
pub fn render_login(
|
||||
@@ -16,6 +19,7 @@ pub fn render_login(
|
||||
area: Rect,
|
||||
theme: &Theme,
|
||||
state: &AuthState,
|
||||
app_state: &AppState, // Add AppState parameter
|
||||
is_edit_mode: bool,
|
||||
) {
|
||||
// Main container
|
||||
@@ -129,4 +133,15 @@ pub fn render_login(
|
||||
chunks[1],
|
||||
);
|
||||
}
|
||||
|
||||
if app_state.ui.dialog.show_dialog {
|
||||
dialog::render_dialog(
|
||||
f,
|
||||
f.area(), // Use area() instead of deprecated size()
|
||||
theme,
|
||||
&app_state.ui.dialog.dialog_title,
|
||||
&app_state.ui.dialog.dialog_message,
|
||||
app_state.ui.dialog.dialog_button_active,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user