diff --git a/app/index.html b/app/index.html index cbe820c..d99c083 100644 --- a/app/index.html +++ b/app/index.html @@ -6,15 +6,19 @@ LLDAP Administration + + diff --git a/app/index_local.html b/app/index_local.html index 58e956b..59f0955 100644 --- a/app/index_local.html +++ b/app/index_local.html @@ -6,13 +6,16 @@ LLDAP Administration + + diff --git a/app/src/components/app.rs b/app/src/components/app.rs index 72a57a7..36a6308 100644 --- a/app/src/components/app.rs +++ b/app/src/components/app.rs @@ -17,6 +17,7 @@ use crate::{ }; use gloo_console::error; +use wasm_bindgen::prelude::*; use yew::{ function_component, html::Scope, @@ -29,6 +30,25 @@ use yew_router::{ BrowserRouter, Switch, }; +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(js_namespace = darkmode)] + fn toggleDarkMode(doSave: bool); + + #[wasm_bindgen] + fn inDarkMode() -> bool; +} + +#[function_component(DarkModeToggle)] +pub fn dark_mode_toggle() -> Html { + html! { +
+ + +
+ } +} + #[function_component(AppContainer)] pub fn app_container() -> Html { html! { @@ -242,7 +262,7 @@ impl App {
- +

{"LLDAP"}

@@ -251,7 +271,7 @@ impl App { <>
  • {"Users"} @@ -259,7 +279,7 @@ impl App {
  • {"Groups"} @@ -269,6 +289,7 @@ impl App { } } else { html!{} } } { self.view_user_menu(ctx) } +
  • @@ -281,7 +302,7 @@ impl App { html! {