From d1909554c42daa09d89a4d0cb98c3ebb1a863411 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Mon, 8 Jul 2024 14:40:17 +0800 Subject: [PATCH] feat(leptos-v0.7): demo --- demo/Trunk.toml | 2 +- demo/src/components/site_header.rs | 195 +++++++++--------- demo/src/pages/components.rs | 2 +- demo_markdown/docs/button/mod.md | 4 +- demo_markdown/docs/input/mod.md | 8 +- demo_markdown/docs/textarea/mod.md | 8 +- demo_markdown/docs/upload/mod.md | 12 +- .../src/auto_complete/auto_complete_option.rs | 2 +- thaw/src/lib.rs | 2 - thaw/src/space/mod.rs | 57 +++-- thaw/src/tag/mod.rs | 1 - thaw_components/src/css_transition/mod.rs | 3 +- thaw_utils/src/class_list.rs | 6 +- thaw_utils/src/hooks/use_lock_html_scroll.rs | 2 +- 14 files changed, 151 insertions(+), 153 deletions(-) diff --git a/demo/Trunk.toml b/demo/Trunk.toml index 3b9db18..acbe41f 100644 --- a/demo/Trunk.toml +++ b/demo/Trunk.toml @@ -1,7 +1,7 @@ [build] target = "index.html" # public_url = "/thaw/" -# release = true +release = true # filehash = false [watch] diff --git a/demo/src/components/site_header.rs b/demo/src/components/site_header.rs index 28e69a0..1b285a7 100644 --- a/demo/src/components/site_header.rs +++ b/demo/src/components/site_header.rs @@ -7,26 +7,26 @@ use thaw::*; #[component] pub fn SiteHeader() -> impl IntoView { - // let theme = Theme::use_rw_theme(); - // let theme_name = Memo::new(move |_| { - // theme.with(|theme| { - // if theme.name == *"light" { - // "Dark".to_string() - // } else { - // "Light".to_string() - // } - // }) - // }); - // // let (_, write_theme, _) = use_local_storage::("theme"); - // let change_theme = Callback::new(move |_| { - // if theme_name.get_untracked() == "Light" { - // theme.set(Theme::light()); - // // write_theme.set("light".to_string()); - // } else { - // theme.set(Theme::dark()); - // // write_theme.set("dark".to_string()); - // } - // }); + let theme = Theme::use_rw_theme(); + let theme_name = Memo::new(move |_| { + theme.with(|theme| { + if theme.name == *"light" { + "Dark".to_string() + } else { + "Light".to_string() + } + }) + }); + // let (_, write_theme, _) = use_local_storage::("theme"); + let change_theme = Callback::new(move |_| { + if theme_name.get_untracked() == "Light" { + theme.set(Theme::light()); + // write_theme.set("light".to_string()); + } else { + theme.set(Theme::dark()); + // write_theme.set("dark".to_string()); + } + }); let search_value = RwSignal::new(String::new()); let search_all_options = StoredValue::new(gen_search_all_options()); @@ -130,86 +130,85 @@ pub fn SiteHeader() -> impl IntoView { } " - - "123" - // - // - //
"Thaw UI"
- //
- // - // - // - // {option.label} - // - // - // - // - // - // - // - // - // - // + + - + } ``` diff --git a/demo_markdown/docs/input/mod.md b/demo_markdown/docs/input/mod.md index abc7586..63793a9 100644 --- a/demo_markdown/docs/input/mod.md +++ b/demo_markdown/docs/input/mod.md @@ -42,9 +42,7 @@ view! { let value = RwSignal::new(String::from("o")); view! { - - - + } ``` @@ -62,9 +60,7 @@ view! { let value = RwSignal::new(String::from("o")); view! { - - - + } ``` diff --git a/demo_markdown/docs/textarea/mod.md b/demo_markdown/docs/textarea/mod.md index bf8160f..b2a880f 100644 --- a/demo_markdown/docs/textarea/mod.md +++ b/demo_markdown/docs/textarea/mod.md @@ -4,9 +4,7 @@ let value = RwSignal::new(String::from("o")); view! { - -