Rendering isn't great, but that seems to work good enough for now.

beta
Philippe Pittoli 2024-02-23 03:15:11 +01:00
parent 27a96dc74e
commit b3b84959e6
1 changed files with 7 additions and 8 deletions

View File

@ -95,10 +95,7 @@ handleQuery = case _ of
render :: forall m. State -> H.ComponentHTML Action () m render :: forall m. State -> H.ComponentHTML Action () m
render { logged, active, admin } render { logged, active, admin }
= HH.div_ = HH.div_
[ case active of [ main_nav
true -> Bulma.btn "ACTIVE" ToggleMenu
false -> Bulma.alert_btn "NOT ACTIVE" ToggleMenu
, main_nav
[ nav_brand [ logo, burger_menu ] [ nav_brand [ logo, burger_menu ]
, nav_menu , nav_menu
[ navbar_start [ left_bar_div ] [ navbar_start [ left_bar_div ]
@ -125,20 +122,22 @@ render { logged, active, admin }
logo = HH.a [HP.classes C.navbar_item, HP.href "/"] [HH.img [HP.src "/logo.jpeg", HP.width 112, HP.height 28]] logo = HH.a [HP.classes C.navbar_item, HP.href "/"] [HH.img [HP.src "/logo.jpeg", HP.width 112, HP.height 28]]
burger_menu = burger_menu =
HH.a [ HP.classes C.navbar_burger HH.a [ HP.classes $ C.navbar_burger <> if active then C.is_active else []
, ARIA.label "menu" , ARIA.label "menu"
, ARIA.expanded "false" , ARIA.expanded "false"
, Bulma.data_target "navbarExample" , Bulma.data_target "navbar-netlibre"
, HE.onClick (\_ -> ToggleMenu)
] [ HH.span [ARIA.hidden "true"] [] ] [ HH.span [ARIA.hidden "true"] []
, HH.span [ARIA.hidden "true"] [] , HH.span [ARIA.hidden "true"] []
, HH.span [ARIA.hidden "true"] [] , HH.span [ARIA.hidden "true"] []
] ]
nav_brand = HH.div [HP.classes C.navbar_brand] nav_brand = HH.div [HP.classes C.navbar_brand]
nav_menu = HH.div [HP.id "navbarExample", HP.classes C.navbar_menu] nav_menu = HH.div [HP.id "navbar-netlibre", HP.classes $ C.navbar_menu <> if active then C.is_active else []]
navbar_start = HH.div [HP.classes C.navbar_start] navbar_start = HH.div [HP.classes C.navbar_start]
navbar_end = HH.div [HP.classes C.navbar_end] navbar_end = HH.div [HP.classes C.navbar_end]
link_home = nav_button C.is_info "Home" (Navigate Home) link_home = nav_button C.is_info "Home" (Navigate Home)
link_domains = nav_button C.is_info "Domains" (Navigate DomainList) link_domains = nav_button C.is_info "Domains" (Navigate DomainList)
link_authd_admin = nav_button C.is_info "Admin" (Navigate Administration) link_authd_admin = nav_button C.is_info "Admin" (Navigate Administration)
@ -168,6 +167,6 @@ render { logged, active, admin }
] ]
btn c action str btn c action str
= HH.a [ HP.classes (C.button <> c) = HH.a [ HP.classes (C.navbar_item <> C.button <> c)
, HE.onClick (\_ -> action) , HE.onClick (\_ -> action)
] [ str ] ] [ str ]