moved introstate into the state folder
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use std::env;
|
||||
use common::proto::multieko2::table_definition::ProfileTreeResponse;
|
||||
use crate::components::IntroState;
|
||||
use crate::state::pages::intro::IntroState;
|
||||
use crate::modes::handlers::mode_manager::AppMode;
|
||||
use crate::ui::handlers::context::DialogPurpose;
|
||||
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
pub mod form;
|
||||
pub mod auth;
|
||||
pub mod admin;
|
||||
pub mod intro;
|
||||
pub mod canvas_state;
|
||||
|
||||
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