UI improvements - optimized for small screens, drawer now works properly, disabled scrolling when modal dialog is appeared.
This commit is contained in:
+24
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user