From 8e56096f837ba75da7fdd1cd1d03dc5584c61ed3 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 21 Mar 2024 16:56:24 +0800 Subject: [PATCH] fix style of nav --- .../header/nav/nav-selector/index.tsx | 118 ++++++++---------- 1 file changed, 53 insertions(+), 65 deletions(-) diff --git a/web/app/components/header/nav/nav-selector/index.tsx b/web/app/components/header/nav/nav-selector/index.tsx index 15da5885d9..8afcbf66a0 100644 --- a/web/app/components/header/nav/nav-selector/index.tsx +++ b/web/app/components/header/nav/nav-selector/index.tsx @@ -1,6 +1,6 @@ 'use client' import { useCallback } from 'react' -import { ChevronDownIcon, PlusIcon } from '@heroicons/react/24/solid' +import cn from 'classnames' import { Menu } from '@headlessui/react' import { useRouter } from 'next/navigation' import { debounce } from 'lodash-es' @@ -8,6 +8,8 @@ import Indicator from '../../indicator' import AppIcon from '@/app/components/base/app-icon' import { useAppContext } from '@/context/app-context' import { useStore as useAppStore } from '@/app/components/app/store' +import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows' +import { Plus } from '@/app/components/base/icons/src/vender/line/general' export type NavItem = { id: string @@ -24,11 +26,6 @@ export type INavSelectorProps = { onLoadmore?: () => void } -const itemClassName = ` - flex items-center w-full h-10 px-3 text-gray-700 text-[14px] - rounded-lg font-normal hover:bg-gray-100 cursor-pointer truncate -` - const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSelectorProps) => { const router = useRouter() const { isCurrentWorkspaceManager } = useAppContext() @@ -46,67 +43,58 @@ const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSel return (
-
- -
{curNav?.name}
-
-
- -
- { - navs.map(nav => ( - -
{ - setAppDetail() - router.push(nav.link) - }} title={nav.name}> -
- -
- + {({ open }) => ( + <> + +
{curNav?.name}
+
+ +
+ { + navs.map(nav => ( + +
{ + setAppDetail() + router.push(nav.link) + }} title={nav.name}> +
+ +
+ +
+
+ {nav.name}
-
- {nav.name} -
- - )) - } -
- {isCurrentWorkspaceManager && -
-
-
- -
-
{createText}
+ + )) + }
-
-
} - + {isCurrentWorkspaceManager && +
+
+
+ +
+
{createText}
+
+
+
} + + + )}
)