refactor: use indoc!
for better formatting of cat ascii art
This commit is contained in:
parent
fc41a499e6
commit
764cddee0e
1 changed files with 13 additions and 6 deletions
|
@ -1,10 +1,18 @@
|
|||
use color_eyre::Result;
|
||||
use indoc::indoc;
|
||||
use ratatui::{prelude::*, widgets::*};
|
||||
use tokio::sync::mpsc::UnboundedSender;
|
||||
|
||||
use super::Component;
|
||||
use crate::{action::Action, config::Config};
|
||||
|
||||
const CAT_ASCII_ART: &str = indoc! {r#"
|
||||
|\__/,| (`\
|
||||
|_ _ |.--.) )
|
||||
( T ) /
|
||||
(((^_(((/(((_>
|
||||
"#};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Cat {
|
||||
command_tx: Option<UnboundedSender<Action>>,
|
||||
|
@ -38,13 +46,12 @@ impl Component for Cat {
|
|||
}
|
||||
|
||||
fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> {
|
||||
const CART: &str = r#" |\__/,| (`\
|
||||
|_ _ |.--.) )
|
||||
( T ) /
|
||||
(((^_(((/(((_>"#;
|
||||
|
||||
frame.render_widget(
|
||||
Paragraph::new(CART).style(Style::default().fg(Color::Magenta).add_modifier(Modifier::SLOW_BLINK | Modifier::BOLD)),
|
||||
Paragraph::new(CAT_ASCII_ART).style(
|
||||
Style::default()
|
||||
.fg(Color::Magenta)
|
||||
.add_modifier(Modifier::SLOW_BLINK | Modifier::BOLD),
|
||||
),
|
||||
Rect {
|
||||
x: area.width - 17,
|
||||
y: area.height - 4,
|
||||
|
|
Loading…
Add table
Reference in a new issue