fixes
This commit is contained in:
40
src/ui/loading.rs
Normal file
40
src/ui/loading.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
use ratatui::{
|
||||
layout::{Alignment, Constraint, Direction, Layout},
|
||||
style::{Color, Modifier, Style},
|
||||
widgets::{Block, Borders, Paragraph},
|
||||
Frame,
|
||||
};
|
||||
use crate::app::App;
|
||||
|
||||
pub fn render(f: &mut Frame, app: &App) {
|
||||
let area = f.area();
|
||||
|
||||
let chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints([
|
||||
Constraint::Percentage(40),
|
||||
Constraint::Length(5),
|
||||
Constraint::Percentage(40),
|
||||
])
|
||||
.split(area);
|
||||
|
||||
let message = app
|
||||
.status_message
|
||||
.as_deref()
|
||||
.unwrap_or("Загрузка...");
|
||||
|
||||
let loading = Paragraph::new(message)
|
||||
.style(
|
||||
Style::default()
|
||||
.fg(Color::Cyan)
|
||||
.add_modifier(Modifier::BOLD),
|
||||
)
|
||||
.alignment(Alignment::Center)
|
||||
.block(
|
||||
Block::default()
|
||||
.borders(Borders::ALL)
|
||||
.title(" TTUI "),
|
||||
);
|
||||
|
||||
f.render_widget(loading, chunks[1]);
|
||||
}
|
||||
Reference in New Issue
Block a user