moved introstate into the state folder
This commit is contained in:
26
client/src/state/pages/intro.rs
Normal file
26
client/src/state/pages/intro.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
// src/state/pages/intro.rs
|
||||
use ratatui::style::Modifier;
|
||||
|
||||
#[derive(Default, Clone, Debug)]
|
||||
pub struct IntroState {
|
||||
pub selected_option: usize,
|
||||
}
|
||||
|
||||
impl IntroState {
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
pub fn next_option(&mut self) {
|
||||
self.selected_option = (self.selected_option + 1) % 4;
|
||||
}
|
||||
|
||||
pub fn previous_option(&mut self) {
|
||||
self.selected_option = if self.selected_option == 0 {
|
||||
3
|
||||
} else {
|
||||
self.selected_option - 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user