mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 09:09:21 -05:00
added is_dark_preferred to ssr example
This commit is contained in:
parent
1e9e03feb8
commit
3a75c73767
1 changed files with 5 additions and 2 deletions
|
@ -6,8 +6,8 @@ use leptos_router::*;
|
||||||
use leptos_use::storage::{use_local_storage, StringCodec};
|
use leptos_use::storage::{use_local_storage, StringCodec};
|
||||||
use leptos_use::{
|
use leptos_use::{
|
||||||
use_color_mode, use_debounce_fn, use_event_listener, use_interval, use_intl_number_format,
|
use_color_mode, use_debounce_fn, use_event_listener, use_interval, use_intl_number_format,
|
||||||
use_timestamp, use_window, ColorMode, UseColorModeReturn, UseIntervalReturn,
|
use_preferred_dark, use_timestamp, use_window, ColorMode, UseColorModeReturn,
|
||||||
UseIntlNumberFormatOptions,
|
UseIntervalReturn, UseIntlNumberFormatOptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
|
@ -68,6 +68,8 @@ fn HomePage() -> impl IntoView {
|
||||||
|
|
||||||
let timestamp = use_timestamp();
|
let timestamp = use_timestamp();
|
||||||
|
|
||||||
|
let is_dark_preferred = use_preferred_dark();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<h1>Leptos-Use SSR Example</h1>
|
<h1>Leptos-Use SSR Example</h1>
|
||||||
<button on:click=on_click>Click Me: {count}</button>
|
<button on:click=on_click>Click Me: {count}</button>
|
||||||
|
@ -79,6 +81,7 @@ fn HomePage() -> impl IntoView {
|
||||||
<button on:click=move |_| set_mode.set(ColorMode::Dark)>Change to Dark</button>
|
<button on:click=move |_| set_mode.set(ColorMode::Dark)>Change to Dark</button>
|
||||||
<button on:click=move |_| set_mode.set(ColorMode::Auto)>Change to Auto</button>
|
<button on:click=move |_| set_mode.set(ColorMode::Auto)>Change to Auto</button>
|
||||||
<p>{timestamp}</p>
|
<p>{timestamp}</p>
|
||||||
|
<p>Dark preferred: {is_dark_preferred}</p>
|
||||||
<LocalStorageTest/>
|
<LocalStorageTest/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue