From 3995f55cbcdd2b09ea4a8d7ce511bef0dcbcdf15 Mon Sep 17 00:00:00 2001 From: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Date: Mon, 26 May 2025 10:42:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20update=20Line=20component=20for=20dark?= =?UTF-8?q?=20mode=20support=20and=20improve=20Empty=20co=E2=80=A6=20(#201?= =?UTF-8?q?96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../plugins/marketplace/empty/line.tsx | 34 +++++++++++++++---- .../plugins/plugin-page/empty/index.tsx | 20 +++++------ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/web/app/components/plugins/marketplace/empty/line.tsx b/web/app/components/plugins/marketplace/empty/line.tsx index 19837aa862..35afcc0d03 100644 --- a/web/app/components/plugins/marketplace/empty/line.tsx +++ b/web/app/components/plugins/marketplace/empty/line.tsx @@ -1,17 +1,39 @@ +'use client' +import useTheme from '@/hooks/use-theme' + type LineProps = { className?: string } + const Line = ({ className, }: LineProps) => { + const { theme } = useTheme() + const isDarkMode = theme === 'dark' + + if (isDarkMode) { + return ( + + + + + + + + + + + ) + } + return ( - - + + - - - - + + + + diff --git a/web/app/components/plugins/plugin-page/empty/index.tsx b/web/app/components/plugins/plugin-page/empty/index.tsx index 139567a1b5..d17c4f420b 100644 --- a/web/app/components/plugins/plugin-page/empty/index.tsx +++ b/web/app/components/plugins/plugin-page/empty/index.tsx @@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next' import { SUPPORT_INSTALL_LOCAL_FILE_EXTENSIONS } from '@/config' import { noop } from 'lodash-es' import { useGlobalPublicStore } from '@/context/global-public-context' +import Button from '@/app/components/base/button' const Empty = () => { const { t } = useTranslation() @@ -43,14 +44,14 @@ const Empty = () => { {/* skeleton */}
{Array.from({ length: 20 }).fill(0).map((_, i) => ( -
+
))}
{/* mask */}
-
@@ -58,10 +59,10 @@ const Empty = () => {
-
+
{text}
-
+
{ { icon: Github, text: t('plugin.list.source.github'), action: 'github' }, { icon: FileZip, text: t('plugin.list.source.local'), action: 'local' }, ].map(({ icon: Icon, text, action }) => ( -
{ if (action === 'local') fileInputRef.current?.click() @@ -92,9 +92,9 @@ const Empty = () => { setSelectedAction(action) }} > - - {text} -
+ + {text} + ))}