From 7c431f66b5159a302d16562e621f57e0e2a2e438 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Wed, 26 Jun 2024 22:32:13 +0800 Subject: [PATCH] refactor: mobile component --- demo/src/app.rs | 12 +++---- demo/src/pages/components.rs | 34 +++++++++---------- demo/src/pages/mod.rs | 16 ++++----- demo_markdown/src/lib.rs | 6 ++-- thaw/src/lib.rs | 1 - thaw/src/theme/mod.rs | 8 +---- {thaw/src/mobile => thaw_mobile}/mod.rs | 0 .../src/mobile => thaw_mobile}/nav_bar/mod.rs | 0 .../nav_bar/nav-bar.css | 0 .../mobile => thaw_mobile}/nav_bar/theme.rs | 0 .../src/mobile => thaw_mobile}/tabbar/mod.rs | 0 .../tabbar/tabbar-item.css | 0 .../mobile => thaw_mobile}/tabbar/tabbar.css | 0 .../tabbar/tabbar_item.rs | 0 .../mobile => thaw_mobile}/tabbar/theme.rs | 0 {thaw/src/mobile => thaw_mobile}/toast/mod.rs | 0 .../mobile => thaw_mobile}/toast/toast.css | 0 17 files changed, 35 insertions(+), 42 deletions(-) rename {thaw/src/mobile => thaw_mobile}/mod.rs (100%) rename {thaw/src/mobile => thaw_mobile}/nav_bar/mod.rs (100%) rename {thaw/src/mobile => thaw_mobile}/nav_bar/nav-bar.css (100%) rename {thaw/src/mobile => thaw_mobile}/nav_bar/theme.rs (100%) rename {thaw/src/mobile => thaw_mobile}/tabbar/mod.rs (100%) rename {thaw/src/mobile => thaw_mobile}/tabbar/tabbar-item.css (100%) rename {thaw/src/mobile => thaw_mobile}/tabbar/tabbar.css (100%) rename {thaw/src/mobile => thaw_mobile}/tabbar/tabbar_item.rs (100%) rename {thaw/src/mobile => thaw_mobile}/tabbar/theme.rs (100%) rename {thaw/src/mobile => thaw_mobile}/toast/mod.rs (100%) rename {thaw/src/mobile => thaw_mobile}/toast/toast.css (100%) diff --git a/demo/src/app.rs b/demo/src/app.rs index 01c5978..8f72401 100644 --- a/demo/src/app.rs +++ b/demo/src/app.rs @@ -43,9 +43,9 @@ fn TheRouter(is_routing: RwSignal) -> impl IntoView { - - - + // + // + // @@ -90,9 +90,9 @@ fn TheRouter(is_routing: RwSignal) -> impl IntoView { - - - + // + // + // } } diff --git a/demo/src/pages/components.rs b/demo/src/pages/components.rs index a2b213d..d9b1f31 100644 --- a/demo/src/pages/components.rs +++ b/demo/src/pages/components.rs @@ -309,22 +309,22 @@ pub(crate) fn gen_menu_data() -> Vec { }, ], }, - MenuGroupOption { - label: "Mobile Components".into(), - children: vec![ - MenuItemOption { - value: "/components/nav-bar".into(), - label: "Nav Bar".into(), - }, - MenuItemOption { - value: "/components/tabbar".into(), - label: "Tabbar".into(), - }, - MenuItemOption { - value: "/components/toast".into(), - label: "Toast".into(), - }, - ], - }, + // MenuGroupOption { + // label: "Mobile Components".into(), + // children: vec![ + // MenuItemOption { + // value: "/components/nav-bar".into(), + // label: "Nav Bar".into(), + // }, + // MenuItemOption { + // value: "/components/tabbar".into(), + // label: "Tabbar".into(), + // }, + // MenuItemOption { + // value: "/components/toast".into(), + // label: "Toast".into(), + // }, + // ], + // }, ] } diff --git a/demo/src/pages/mod.rs b/demo/src/pages/mod.rs index b90761d..763083c 100644 --- a/demo/src/pages/mod.rs +++ b/demo/src/pages/mod.rs @@ -1,15 +1,15 @@ mod components; mod home; mod markdown; -mod mobile; -mod nav_bar; -mod tabbar; -mod toast; +// mod mobile; +// mod nav_bar; +// mod tabbar; +// mod toast; pub use components::*; pub use home::*; pub use markdown::*; -pub use mobile::*; -pub use nav_bar::*; -pub use tabbar::*; -pub use toast::*; +// pub use mobile::*; +// pub use nav_bar::*; +// pub use tabbar::*; +// pub use toast::*; diff --git a/demo_markdown/src/lib.rs b/demo_markdown/src/lib.rs index 3a29e36..91867ef 100644 --- a/demo_markdown/src/lib.rs +++ b/demo_markdown/src/lib.rs @@ -25,9 +25,9 @@ pub fn include_md(_token_stream: proc_macro::TokenStream) -> proc_macro::TokenSt "InstallationMdPage" => "../docs/_guide/installation.md", "ServerSiderRenderingMdPage" => "../docs/_guide/server_sider_rendering.md", "UsageMdPage" => "../docs/_guide/usage.md", - "NavBarMdPage" => "../docs/_mobile/nav_bar/mod.md", - "TabbarMdPage" => "../docs/_mobile/tabbar/mod.md", - "ToastMdPage" => "../docs/_mobile/toast/mod.md", + // "NavBarMdPage" => "../docs/_mobile/nav_bar/mod.md", + // "TabbarMdPage" => "../docs/_mobile/tabbar/mod.md", + // "ToastMdPage" => "../docs/_mobile/toast/mod.md", "AccordionMdPage" => "../docs/accordion/mod.md", "AlertMdPage" => "../docs/alert/mod.md", "AnchorMdPage" => "../docs/anchor/mod.md", diff --git a/thaw/src/lib.rs b/thaw/src/lib.rs index 58e5204..909b259 100644 --- a/thaw/src/lib.rs +++ b/thaw/src/lib.rs @@ -23,7 +23,6 @@ mod input; mod layout; mod loading_bar; mod message; -pub mod mobile; mod modal; mod nav; mod popover; diff --git a/thaw/src/theme/mod.rs b/thaw/src/theme/mod.rs index 03578ed..7b51c27 100644 --- a/thaw/src/theme/mod.rs +++ b/thaw/src/theme/mod.rs @@ -3,7 +3,6 @@ mod common; use self::common::CommonTheme; use crate::{ - mobile::{NavBarTheme, TabbarTheme}, AlertTheme, AnchorTheme, BackTopTheme, CalendarTheme, MessageTheme, ProgressTheme, ScrollbarTheme, SelectTheme, }; @@ -23,8 +22,6 @@ pub struct Theme { pub alert: AlertTheme, pub message: MessageTheme, pub select: SelectTheme, - pub nav_bar: NavBarTheme, - pub tabbar: TabbarTheme, pub progress: ProgressTheme, pub calendar: CalendarTheme, pub scrollbar: ScrollbarTheme, @@ -41,8 +38,7 @@ impl Theme { alert: AlertTheme::light(), message: MessageTheme::light(), select: SelectTheme::light(), - nav_bar: NavBarTheme::light(), - tabbar: TabbarTheme::light(), + progress: ProgressTheme::light(), calendar: CalendarTheme::light(), scrollbar: ScrollbarTheme::light(), @@ -58,8 +54,6 @@ impl Theme { alert: AlertTheme::dark(), message: MessageTheme::dark(), select: SelectTheme::dark(), - nav_bar: NavBarTheme::dark(), - tabbar: TabbarTheme::dark(), progress: ProgressTheme::dark(), calendar: CalendarTheme::dark(), scrollbar: ScrollbarTheme::dark(), diff --git a/thaw/src/mobile/mod.rs b/thaw_mobile/mod.rs similarity index 100% rename from thaw/src/mobile/mod.rs rename to thaw_mobile/mod.rs diff --git a/thaw/src/mobile/nav_bar/mod.rs b/thaw_mobile/nav_bar/mod.rs similarity index 100% rename from thaw/src/mobile/nav_bar/mod.rs rename to thaw_mobile/nav_bar/mod.rs diff --git a/thaw/src/mobile/nav_bar/nav-bar.css b/thaw_mobile/nav_bar/nav-bar.css similarity index 100% rename from thaw/src/mobile/nav_bar/nav-bar.css rename to thaw_mobile/nav_bar/nav-bar.css diff --git a/thaw/src/mobile/nav_bar/theme.rs b/thaw_mobile/nav_bar/theme.rs similarity index 100% rename from thaw/src/mobile/nav_bar/theme.rs rename to thaw_mobile/nav_bar/theme.rs diff --git a/thaw/src/mobile/tabbar/mod.rs b/thaw_mobile/tabbar/mod.rs similarity index 100% rename from thaw/src/mobile/tabbar/mod.rs rename to thaw_mobile/tabbar/mod.rs diff --git a/thaw/src/mobile/tabbar/tabbar-item.css b/thaw_mobile/tabbar/tabbar-item.css similarity index 100% rename from thaw/src/mobile/tabbar/tabbar-item.css rename to thaw_mobile/tabbar/tabbar-item.css diff --git a/thaw/src/mobile/tabbar/tabbar.css b/thaw_mobile/tabbar/tabbar.css similarity index 100% rename from thaw/src/mobile/tabbar/tabbar.css rename to thaw_mobile/tabbar/tabbar.css diff --git a/thaw/src/mobile/tabbar/tabbar_item.rs b/thaw_mobile/tabbar/tabbar_item.rs similarity index 100% rename from thaw/src/mobile/tabbar/tabbar_item.rs rename to thaw_mobile/tabbar/tabbar_item.rs diff --git a/thaw/src/mobile/tabbar/theme.rs b/thaw_mobile/tabbar/theme.rs similarity index 100% rename from thaw/src/mobile/tabbar/theme.rs rename to thaw_mobile/tabbar/theme.rs diff --git a/thaw/src/mobile/toast/mod.rs b/thaw_mobile/toast/mod.rs similarity index 100% rename from thaw/src/mobile/toast/mod.rs rename to thaw_mobile/toast/mod.rs diff --git a/thaw/src/mobile/toast/toast.css b/thaw_mobile/toast/toast.css similarity index 100% rename from thaw/src/mobile/toast/toast.css rename to thaw_mobile/toast/toast.css