From f408899eda11338703f2227b4866390bb98aec25 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Sun, 25 Aug 2024 00:33:57 +0800 Subject: [PATCH] feat: change the type of dir in ConfigProvider --- demo/src/app.rs | 3 ++- demo/src/components/site_header.rs | 27 +++++++++++++++++++++++++++ thaw/src/back_top/mod.rs | 2 +- thaw/src/button/button.css | 2 +- thaw/src/color_picker/mod.rs | 2 +- thaw/src/combobox/listbox.rs | 2 +- thaw/src/config_provider/mod.rs | 21 +++++++++------------ thaw/src/date_picker/panel/mod.rs | 2 +- thaw/src/dialog/dialog.rs | 2 +- thaw/src/drawer/overlay_drawer.rs | 2 +- thaw/src/loading_bar/mod.rs | 2 +- thaw/src/menu/mod.rs | 2 +- thaw/src/popover/mod.rs | 2 +- thaw/src/time_picker/mod.rs | 2 +- thaw/src/toast/toaster.rs | 2 +- thaw/src/tooltip/tooltip.rs | 2 +- 16 files changed, 51 insertions(+), 26 deletions(-) diff --git a/demo/src/app.rs b/demo/src/app.rs index c7f4575..1ab9c20 100644 --- a/demo/src/app.rs +++ b/demo/src/app.rs @@ -16,9 +16,10 @@ pub fn App() -> impl IntoView { provide_meta_context(); // let (read_theme, _, _) = use_local_storage::("theme"); // let theme = RwSignal::new(Theme::from(read_theme.get_untracked())); + let dir = RwSignal::new(ConfigDirection::Ltr); view! { - + diff --git a/demo/src/components/site_header.rs b/demo/src/components/site_header.rs index ecdf7b7..8951741 100644 --- a/demo/src/components/site_header.rs +++ b/demo/src/components/site_header.rs @@ -9,6 +9,7 @@ use thaw::*; pub fn SiteHeader() -> impl IntoView { let navigate = use_navigate(); let navigate_signal = RwSignal::new(use_navigate()); + let dir = ConfigInjection::expect_context().dir; let theme = Theme::use_rw_theme(); let theme_name = Memo::new(move |_| { theme.with(|theme| { @@ -221,6 +222,32 @@ pub fn SiteHeader() -> impl IntoView { > {move || theme_name.get()} +