aboutsummaryrefslogtreecommitdiff
path: root/src/components/hello_world.rs
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-03-07 02:05:03 -0500
committerShav Kinderlehrer <[email protected]>2024-03-07 02:05:03 -0500
commitfa3e812a301455c7bc7b4d829a7fba01ddaea413 (patch)
treea7f5c2b3b500c8780b6460f6d1107965680f7148 /src/components/hello_world.rs
parentc2acb446e7868b67e5743d54cee5c64c469e5a18 (diff)
downloadmolehole-fa3e812a301455c7bc7b4d829a7fba01ddaea413.tar.gz
molehole-fa3e812a301455c7bc7b4d829a7fba01ddaea413.zip
Implement keyboard shortcut popup
Diffstat (limited to 'src/components/hello_world.rs')
-rw-r--r--src/components/hello_world.rs20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/components/hello_world.rs b/src/components/hello_world.rs
index 2e3a2ee..ac9d02b 100644
--- a/src/components/hello_world.rs
+++ b/src/components/hello_world.rs
@@ -1,9 +1,7 @@
-use ratatui::prelude::*;
-use ratatui::widgets::Paragraph;
+use ratatui::prelude::{Frame, Rect};
+use ratatui::widgets::{Paragraph, Wrap};
-use crate::app_action::AppAction;
use crate::component::Component;
-use crate::keys::key_commands::*;
#[derive(Default, Clone)]
pub struct HelloWorld {
@@ -16,17 +14,11 @@ impl Component for HelloWorld {
Ok(())
}
- fn handle_key_event(
- &mut self,
- key: crossterm::event::KeyEvent,
- ) -> eyre::Result<Option<AppAction>> {
- self.text = serialize_key_event(key);
- Ok(None)
- }
-
fn render(&mut self, frame: &mut Frame, rect: Rect) -> eyre::Result<()> {
-
- frame.render_widget(Paragraph::new(self.text.clone()), rect);
+ frame.render_widget(
+ Paragraph::new(self.text.clone()).wrap(Wrap { trim: true }),
+ rect,
+ );
Ok(())
}