From 5ef8410da5cbc67ad7fc6bd63775e325aaf57828 Mon Sep 17 00:00:00 2001 From: kunish Date: Fri, 22 Sep 2023 16:05:36 +0800 Subject: [PATCH] feat(button): icon button --- src/components/Button.tsx | 24 ++++++++++-- src/components/Header.tsx | 5 +-- src/pages/Config.tsx | 4 +- src/pages/Connections.tsx | 27 ++++++-------- src/pages/Logs.tsx | 5 +-- src/pages/Proxies.tsx | 77 ++++++++++++++++++++------------------- 6 files changed, 76 insertions(+), 66 deletions(-) diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 1f84489..58732c7 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -5,13 +5,22 @@ export const Button: ParentComponent< JSX.ButtonHTMLAttributes & { loading?: boolean disabled?: boolean + icon?: JSX.Element } > = (props) => { - const [local, others] = splitProps(props, ['class', 'loading', 'disabled']) + const [local, others] = splitProps(props, [ + 'class', + 'loading', + 'disabled', + 'icon', + ]) return ( ) } diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 1aacd5f..b27040b 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -159,9 +159,8 @@ export const Header = () => { locale(curLocale === LANG.EN ? LANG.ZH : LANG.EN) }} - > - - + icon={} + /> diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index d800940..c5c0b18 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -217,7 +217,7 @@ const ConfigForm = () => { -
+
-
-
+ icon={} + />
), }, @@ -127,9 +126,8 @@ export default () => { + icon={} + />
), }, @@ -348,7 +346,7 @@ export default () => {