feat: add create section
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-09 18:00:25 +02:00
parent 0406fbe14d
commit 105ab41f19
3 changed files with 30 additions and 21 deletions

View File

@@ -251,7 +251,7 @@ impl CreateItemState {
if !title.is_empty() {
let mut path = self.path.clone();
path.push(title.replace(' ', "").replace('.', "-"));
path.push(title.replace([' ', '.'], "-"));
Some(hyperlog_core::commander::Command::CreateItem {
root: self.root.clone(),
@@ -270,18 +270,6 @@ impl CreateItemState {
pub struct CreateItem {}
impl StatefulWidget for &mut CreateItem {
// fn render(self, area: Rect, buf: &mut Buffer)
// where
// Self: Sized,
// {
// //buf.reset();
// // let block = Block::bordered()
// // .title("create item")
// // .padding(Padding::proportional(1));
// }
type State = CreateItemState;
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
@@ -306,9 +294,5 @@ impl StatefulWidget for &mut CreateItem {
title_input.render(chunks[1], buf, &mut state.title);
description_input.render(chunks[2], buf, &mut state.description);
// let title = Paragraph::new("something"); //.block(block);
// title.render(area, buf);
}
}