début du ui

This commit is contained in:
thatscringebro
2025-12-17 07:55:40 -05:00
parent 55dfd16cd2
commit 33fb39e732
3 changed files with 137 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ use crate::{
app::{App, CurrentScreen},
ui::ui,
};
use app::CurrentWidget;
use ratatui::{
Terminal,
crossterm::{
@@ -55,6 +56,12 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
KeyCode::Char('q') => {
app.current_screen = CurrentScreen::Exiting;
}
KeyCode::Right => {
app.current_widget = CurrentWidget::TrxList;
}
KeyCode::Left => {
app.current_widget = CurrentWidget::AccountList;
}
_ => {}
},
CurrentScreen::Exiting => match key.code {
@@ -100,7 +107,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
// match choice {
// "1" => {
// let accounts = data_layer::get_accounts(&connection);
// let accounts = data_layer::get_accounts)(&connection);
// let mut total = 0.0;
// for ac in accounts.iter() {
// let ac_total = ac.get_total(&connection);