UI improvements - optimized for small screens, drawer now works properly, disabled scrolling when modal dialog is appeared.

This commit is contained in:
2023-11-21 18:15:25 +01:00
parent aa2c71af77
commit d7e33e4342
8 changed files with 140 additions and 11 deletions
+24
View File
@@ -36,12 +36,36 @@ impl MenuHelper {
}
}
#[derive(Clone, Copy)]
pub struct DialogHelper {
opened: RwSignal<bool>
}
impl DialogHelper {
pub fn new() -> Self {
let opened = create_rw_signal(false);
Self {
opened
}
}
pub fn set_opened(&self, opened: bool) {
self.opened.set(opened);
}
pub fn is_open(&self) -> bool {
self.opened.get()
}
}
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
init_locales();
provide_context(MenuHelper::new());
provide_context(MenuOpener::new());
provide_context(DialogHelper::new());
view! {
<Header/>