Skip to content

Commit d37952d

Browse files
fix tests, adjust colors
1 parent 678a81b commit d37952d

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/components/data.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ use crate::{
2222

2323
#[derive(Default)]
2424
pub enum DataState {
25-
Loading,
26-
NoResults,
2725
#[default]
2826
Blank,
27+
Loading,
28+
NoResults,
2929
HasResults(Rows),
3030
Error(DbError),
3131
Cancelled,
@@ -201,13 +201,22 @@ impl<'a> Component for Data<'a> {
201201
self.scrollable.draw(f, area, app_state)?;
202202
},
203203
DataState::Error(e) => {
204-
f.render_widget(Paragraph::new(e.to_string()).wrap(Wrap { trim: false }).block(block), area);
204+
f.render_widget(
205+
Paragraph::new(e.to_string()).style(Style::default().fg(Color::Red)).wrap(Wrap { trim: false }).block(block),
206+
area,
207+
);
205208
},
206209
DataState::Loading => {
207-
f.render_widget(Paragraph::new("loading...").wrap(Wrap { trim: false }).block(block), area);
210+
f.render_widget(
211+
Paragraph::new(Text::from("loading...").fg(Color::Green)).wrap(Wrap { trim: false }).block(block),
212+
area,
213+
);
208214
},
209215
DataState::Cancelled => {
210-
f.render_widget(Paragraph::new("query cancelled.").wrap(Wrap { trim: false }).block(block), area);
216+
f.render_widget(
217+
Paragraph::new(Text::from("query cancelled.").fg(Color::Yellow)).wrap(Wrap { trim: false }).block(block),
218+
area,
219+
);
211220
},
212221
}
213222

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ mod tests {
444444
let c = Config::new()?;
445445
assert_eq!(
446446
c.keybindings.get(&Focus::Menu).unwrap().get(&parse_key_sequence("<q>").unwrap_or_default()).unwrap(),
447-
&Action::Quit
447+
&Action::AbortQuery
448448
);
449449
Ok(())
450450
}

0 commit comments

Comments
 (0)