diff --git a/src/app/mod.rs b/src/app/mod.rs index ddb202c..22e1b08 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -42,6 +42,7 @@ pub enum CurrentScreen { pub enum SendingScreen { Files, Peers, + Text, } impl App { @@ -125,6 +126,7 @@ impl App { KeyCode::Enter => todo!("send to the selected peer"), _ => {} }, + SendingScreen::Text => {} }, _ => match key_event.code { KeyCode::Char('q') => self.exit(), diff --git a/src/app/widgets.rs b/src/app/widgets.rs index be73218..41eabb2 100644 --- a/src/app/widgets.rs +++ b/src/app/widgets.rs @@ -71,6 +71,8 @@ static CONTENT_SEND_FILE_MENU: LazyLock = LazyLock::new(|| { "".blue().bold(), " Child Dir ".into(), "".blue().bold(), + " Enter Text ".into(), + "".blue().bold(), " Peers ".into(), "".blue().bold(), " Previous Screen ".into(), @@ -88,6 +90,8 @@ static CONTENT_SEND_PEERS_MENU: LazyLock = LazyLock::new(|| { "".blue().bold(), " Select ".into(), "".blue().bold(), + " Enter Text ".into(), + "".blue().bold(), " Files ".into(), "".blue().bold(), " Previous Screen ".into(), @@ -145,14 +149,24 @@ impl Widget for &mut App { buf, ); } - CurrentScreen::Sending(s) => match s { - SendingScreen::Files => { - outer_frame(*current_screen, &CONTENT_SEND_FILE_MENU, area, buf) + CurrentScreen::Sending(s) => { + match s { + SendingScreen::Files => { + outer_frame(*current_screen, &CONTENT_SEND_FILE_MENU, area, buf) + } + SendingScreen::Peers => { + outer_frame(*current_screen, &CONTENT_SEND_PEERS_MENU, area, buf) + } + SendingScreen::Text => {} } - SendingScreen::Peers => { - outer_frame(*current_screen, &CONTENT_SEND_PEERS_MENU, area, buf) - } - }, + + let peers = PeersWidget { peers: &self.peers }; + + self.file_picker + .widget() + .render(top.inner(subscreen_margin), buf); + peers.render(bottom.inner(subscreen_margin), buf); + } _ => { outer_frame(*current_screen, &MAIN_MENU, area, buf); }