Import/export feature for config and data
This commit is contained in:
@@ -12,6 +12,7 @@ pub struct StatsSidebar<'a> {
|
||||
drill: &'a DrillState,
|
||||
last_result: Option<&'a DrillResult>,
|
||||
history: &'a [DrillResult],
|
||||
target_wpm: u32,
|
||||
theme: &'a Theme,
|
||||
}
|
||||
|
||||
@@ -20,12 +21,14 @@ impl<'a> StatsSidebar<'a> {
|
||||
drill: &'a DrillState,
|
||||
last_result: Option<&'a DrillResult>,
|
||||
history: &'a [DrillResult],
|
||||
target_wpm: u32,
|
||||
theme: &'a Theme,
|
||||
) -> Self {
|
||||
Self {
|
||||
drill,
|
||||
last_result,
|
||||
history,
|
||||
target_wpm,
|
||||
theme,
|
||||
}
|
||||
}
|
||||
@@ -82,6 +85,13 @@ impl Widget for StatsSidebar<'_> {
|
||||
Span::styled("WPM: ", Style::default().fg(colors.fg())),
|
||||
Span::styled(wpm_str, Style::default().fg(colors.accent())),
|
||||
]),
|
||||
Line::from(vec![
|
||||
Span::styled("Target: ", Style::default().fg(colors.fg())),
|
||||
Span::styled(
|
||||
format!("{} WPM", self.target_wpm),
|
||||
Style::default().fg(colors.text_pending()),
|
||||
),
|
||||
]),
|
||||
Line::from(""),
|
||||
Line::from(vec![
|
||||
Span::styled("Accuracy: ", Style::default().fg(colors.fg())),
|
||||
|
||||
Reference in New Issue
Block a user