From 05d273d643244d7853d87c5c8bbfd8ee00bbdf51 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Wed, 8 Jan 2025 15:40:13 +0800 Subject: [PATCH] fix tracing dropdown --- .../overview/tracing/config-button.tsx | 26 +++---------------- .../[appId]/overview/tracing/panel.tsx | 18 ++++++++++--- web/context/app-context.tsx | 2 +- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-button.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-button.tsx index 39fc81a274..ca6fa3a904 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-button.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-button.tsx @@ -4,19 +4,15 @@ import React, { useCallback, useEffect, useRef, useState } from 'react' import { RiEqualizer2Line, } from '@remixicon/react' -import { useTranslation } from 'react-i18next' import type { PopupProps } from './config-popup' import ConfigPopup from './config-popup' import cn from '@/utils/classnames' -import Button from '@/app/components/base/button' import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' -const I18N_PREFIX = 'app.tracing' - type Props = { readOnly: boolean className?: string @@ -30,7 +26,6 @@ const ConfigBtn: FC = ({ controlShowPopup, ...popupProps }) => { - const { t } = useTranslation() const [open, doSetOpen] = useState(false) const openRef = useRef(open) const setOpen = useCallback((v: boolean) => { @@ -52,21 +47,6 @@ const ConfigBtn: FC = ({ if (popupProps.readOnly && !hasConfigured) return null - const triggerContent = hasConfigured - ? ( -
- -
- ) - : ( - - ) - return ( = ({ placement='bottom-end' offset={{ mainAxis: 12, - crossAxis: hasConfigured ? 8 : 0, + crossAxis: hasConfigured ? 8 : 49, }} > - {triggerContent} +
+ +
diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx index 790705e9fb..06621a2ae4 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx @@ -3,7 +3,6 @@ import type { FC } from 'react' import React, { useCallback, useEffect, useState } from 'react' import { RiArrowDownDoubleLine, - RiEqualizer2Line, } from '@remixicon/react' import { useTranslation } from 'react-i18next' import { usePathname } from 'next/navigation' @@ -151,8 +150,21 @@ const Panel: FC = () => { <>
{t(`${I18N_PREFIX}.title`)}
-
- +
e.stopPropagation()}> +
diff --git a/web/context/app-context.tsx b/web/context/app-context.tsx index 25a313a76b..7addfb83d4 100644 --- a/web/context/app-context.tsx +++ b/web/context/app-context.tsx @@ -127,7 +127,7 @@ export const AppContextProvider: FC = ({ children }) => setCurrentWorkspace(currentWorkspaceResponse) }, [currentWorkspaceResponse]) - const [theme, setTheme] = useState(Theme.dark) + const [theme, setTheme] = useState(Theme.light) const handleSetTheme = useCallback((theme: Theme) => { setTheme(theme) globalThis.document.documentElement.setAttribute('data-theme', theme)