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
+10 -1
View File
@@ -1,15 +1,21 @@
use leptos::*;
use leptos_meta::*;
use crate::app::DialogHelper;
use crate::components::user_menu::MenuOpener;
#[component]
pub fn Header() -> impl IntoView {
let drawer = use_context::<MenuOpener>().expect("No drawer opener");
let dlg_helper = use_context::<DialogHelper>().expect("No dialog helper");
view! {
<Html
lang="cz"
dir="ltr"
class = {move || if drawer.visible() {"light-style layout-menu-fixed layout-menu-expanded"}
else {"light-style layout-menu-fixed"} }
attributes=vec![
("data-theme", "theme-default".into_attribute()),
("class", "light-style layout-menu-fixed".into_attribute()),
("data-template", "vertical-menu-template-free".into_attribute()),
("data-assets-path", "/".into_attribute())]
/>
@@ -35,5 +41,8 @@ pub fn Header() -> impl IntoView {
//<!-- Vendors CSS -->
<Link rel="stylesheet" href="/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />
<Body attributes=vec![
("style", {move || if dlg_helper.is_open() {"overflow: hidden;"} else {""}}.into_attribute())
]/>
}
}