termitype 0.0.11

Terminal-based typing test inspired by a certain typing test you might know.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{theme::Theme, tui::helpers::footer_padding};
use ratatui::{
    layout::Alignment,
    prelude::Stylize,
    style::{Modifier, Style},
    widgets::{Block, Paragraph},
};

const APP_VERSION: &str = env!("CARGO_PKG_VERSION");

pub fn create_footer_element<'a>(theme: &Theme) -> Paragraph<'a> {
    let footer_text = format!("{} v{}", theme.id, APP_VERSION);
    Paragraph::new(footer_text)
        .style(Style::default().fg(theme.fg()))
        .add_modifier(Modifier::DIM)
        .alignment(Alignment::Right)
        .block(Block::default().padding(footer_padding()))
}