1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-22 12:31:08 +00:00

Fix dark mode toggle

This commit is contained in:
Felix Ableitner 2024-11-07 13:01:56 +01:00
parent 2fd3999341
commit 1931c53ac5

View file

@ -126,7 +126,13 @@ pub fn Nav() -> impl IntoView {
<input <input
type="checkbox" type="checkbox"
class="toggle" class="toggle"
checked=move || { expect_context::<Darkmode>().is_dark() } checked=move || {
if expect_context::<Darkmode>().is_light() {
"checked"
} else {
""
}
}
on:click=move |_| { expect_context::<Darkmode>().toggle() } on:click=move |_| { expect_context::<Darkmode>().toggle() }
/> />
<span class="label-text">Dark</span> <span class="label-text">Dark</span>