From 931d704612a6b5816ebefb2a5eddc3eed4ebd05b Mon Sep 17 00:00:00 2001 From: NFish Date: Mon, 3 Mar 2025 16:06:28 +0800 Subject: [PATCH] Fix/explore darkmode (#14751) --- web/app/components/explore/app-card/index.tsx | 40 ++++--------------- web/app/components/explore/app-list/index.tsx | 37 ++++++----------- web/app/components/explore/index.tsx | 2 +- .../explore/item-operation/index.tsx | 16 ++++---- .../explore/item-operation/style.module.css | 6 +-- .../explore/sidebar/app-nav-item/index.tsx | 7 +--- .../sidebar/app-nav-item/style.module.css | 9 ----- web/app/components/explore/sidebar/index.tsx | 17 ++++---- 8 files changed, 42 insertions(+), 92 deletions(-) delete mode 100644 web/app/components/explore/sidebar/app-nav-item/style.module.css diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx index 36034195ee..977c38776c 100644 --- a/web/app/components/explore/app-card/index.tsx +++ b/web/app/components/explore/app-card/index.tsx @@ -5,8 +5,7 @@ import Button from '../../base/button' import cn from '@/utils/classnames' import type { App } from '@/models/explore' import AppIcon from '@/app/components/base/app-icon' -import { AiText, ChatBot, CuteRobot } from '@/app/components/base/icons/src/vender/solid/communication' -import { Route } from '@/app/components/base/icons/src/vender/solid/mapsAndTravel' +import { AppTypeIcon } from '../../app/type-selector' export type AppCardProps = { app: App canCreate: boolean @@ -23,7 +22,7 @@ const AppCard = ({ const { t } = useTranslation() const { app: appBasicInfo } = app return ( -
+
- - {appBasicInfo.mode === 'advanced-chat' && ( - - )} - {appBasicInfo.mode === 'agent-chat' && ( - - )} - {appBasicInfo.mode === 'chat' && ( - - )} - {appBasicInfo.mode === 'completion' && ( - - )} - {appBasicInfo.mode === 'workflow' && ( - - )} - +
@@ -64,14 +48,14 @@ const AppCard = ({
-
+
{app.description}
{isExplore && canCreate && ( -
-
+
+
)} - {!isExplore && ( -
-
- -
-
- )}
) } diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index 4fef183d52..df15348dd3 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -17,7 +17,6 @@ import { fetchAppDetail, fetchAppList } from '@/service/explore' import { importDSL } from '@/service/apps' import { useTabSearchParams } from '@/hooks/use-tab-searchparams' import CreateAppModal from '@/app/components/explore/create-app-modal' -import AppTypeSelector from '@/app/components/app/type-selector' import type { CreateAppModalProps } from '@/app/components/explore/create-app-modal' import Loading from '@/app/components/base/loading' import { NEED_REFRESH_APP_LIST_KEY } from '@/config' @@ -28,7 +27,6 @@ import { DSLImportMode } from '@/models/app' import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks' type AppsProps = { - pageType?: PageType onSuccess?: () => void } @@ -38,7 +36,6 @@ export enum PageType { } const Apps = ({ - pageType = PageType.EXPLORE, onSuccess, }: AppsProps) => { const { t } = useTranslation() @@ -62,7 +59,7 @@ const Apps = ({ const [currentType, setCurrentType] = useState('') const [currCategory, setCurrCategory] = useTabSearchParams({ defaultTab: allCategoriesEn, - disableSearchParams: pageType !== PageType.EXPLORE, + disableSearchParams: false, }) const { @@ -166,26 +163,18 @@ const Apps = ({ return (
- {pageType === PageType.EXPLORE && ( -
-
{t('explore.apps.title')}
-
{t('explore.apps.description')}
-
- )} + +
+
{t('explore.apps.title')}
+
{t('explore.apps.description')}
+
+
<> - {pageType !== PageType.EXPLORE && ( - <> - -
- - )}