diff --git a/web/app/account/avatar.tsx b/web/app/account/avatar.tsx index bd9cbec4c4..cd9e582e5f 100644 --- a/web/app/account/avatar.tsx +++ b/web/app/account/avatar.tsx @@ -2,13 +2,13 @@ import { useTranslation } from 'react-i18next' import { Fragment } from 'react' import { useRouter } from 'next/navigation' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import Avatar from '@/app/components/base/avatar' import { logout } from '@/service/common' import { useAppContext } from '@/context/app-context' import { LogOut01 } from '@/app/components/base/icons/src/vender/line/general' -export interface IAppSelector { +export type IAppSelector = { isMobile: boolean } @@ -36,7 +36,7 @@ export default function AppSelector() { ({ open }) => ( <>
- - +
- - +
@@ -74,8 +74,8 @@ export default function AppSelector() {
- - + +
handleLogout()}>
{t('common.userProfile.logout')}
-
-
+ +
) diff --git a/web/app/components/app/annotation/header-opts/index.tsx b/web/app/components/app/annotation/header-opts/index.tsx index 649d6501c3..d57bc74e7d 100644 --- a/web/app/components/app/annotation/header-opts/index.tsx +++ b/web/app/components/app/annotation/header-opts/index.tsx @@ -10,7 +10,7 @@ import { useContext } from 'use-context-selector' import { useCSVDownloader, } from 'react-papaparse' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react' import Button from '../../../base/button' import AddAnnotationModal from '../add-annotation-modal' import type { AnnotationItemBasic } from '../type' @@ -87,11 +87,11 @@ const HeaderOptions: FC = ({ {t('appAnnotation.table.header.bulkImport')} - + {t('appAnnotation.table.header.bulkExport')} - + = ({ leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - = ({ - + diff --git a/web/app/components/app/create-app-dialog/newAppDialog.tsx b/web/app/components/app/create-app-dialog/newAppDialog.tsx index 21459773a6..33e7d779f5 100644 --- a/web/app/components/app/create-app-dialog/newAppDialog.tsx +++ b/web/app/components/app/create-app-dialog/newAppDialog.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback } from 'react' import type { ReactNode } from 'react' -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition } from '@headlessui/react' import cn from '@/utils/classnames' type DialogProps = { @@ -20,7 +20,7 @@ const NewAppDialog = ({ return ( -
- + */} + {/* TODO: to new Transition */} +
- - + {children} - - + + */} + {/* TODO: to new Transition */} + + {children} +
diff --git a/web/app/components/base/dialog/index.tsx b/web/app/components/base/dialog/index.tsx index f43906777b..6554ef9009 100644 --- a/web/app/components/base/dialog/index.tsx +++ b/web/app/components/base/dialog/index.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback } from 'react' import type { ElementType, ReactNode } from 'react' -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, DialogTitle, Transition } from '@headlessui/react' import classNames from '@/utils/classnames' // https://headlessui.com/react/dialog @@ -34,7 +34,7 @@ const CustomDialog = ({ return ( -
- + */} + {/* TODO: to new Transition */} +
- - + {Boolean(title) && ( - {title} - + )}
{children} @@ -74,8 +76,27 @@ const CustomDialog = ({ {footer}
)} -
-
+ + */} + {/* TODO: to new Transition */} + + {Boolean(title) && ( + + {title} + + )} +
+ {children} +
+ {Boolean(footer) && ( +
+ {footer} +
+ )} +
diff --git a/web/app/components/base/drawer/index.tsx b/web/app/components/base/drawer/index.tsx index e34dc7697a..cb6d75b4b8 100644 --- a/web/app/components/base/drawer/index.tsx +++ b/web/app/components/base/drawer/index.tsx @@ -1,5 +1,5 @@ 'use client' -import { Dialog } from '@headlessui/react' +import { Dialog, DialogBackdrop, DialogTitle } from '@headlessui/react' import { useTranslation } from 'react-i18next' import { XMarkIcon } from '@heroicons/react/24/outline' import Button from '../button' @@ -48,21 +48,21 @@ export default function Drawer({ >
{/* mask */} -
<> - {title && {title} - } - {showClose && + } + {showClose && - } - {description && {description}} + } + {description &&
{description}
} {children} {footer || (footer === null diff --git a/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx b/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx index e2b03faad2..c61a325858 100644 --- a/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx +++ b/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback } from 'react' import type { ReactNode } from 'react' -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition } from '@headlessui/react' import cn from '@/utils/classnames' type DialogProps = { @@ -22,7 +22,7 @@ const DialogWrapper = ({ return ( -
- + */} + {/* TODO: to new Transition */} +
- - + {children} - - + + */} + {/* TODO: to new Transition */} + + {children} +
diff --git a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx index 360ea8a72a..94775172c4 100644 --- a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx +++ b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx @@ -5,7 +5,7 @@ import React, { Fragment } from 'react' import { usePathname } from 'next/navigation' import { useTranslation } from 'react-i18next' import { RiCloseLine } from '@remixicon/react' -import { Listbox, Transition } from '@headlessui/react' +import { Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from '@headlessui/react' import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid' import { useFeatures, useFeaturesStore } from '@/app/components/base/features/hooks' import type { Item } from '@/app/components/base/select' @@ -67,7 +67,7 @@ const VoiceParamConfig = ({ <>
{t('appDebug.voice.voiceSettings.title')}
-
+
@@ -92,7 +92,7 @@ const VoiceParamConfig = ({ }} >
- {languageItem?.name ? t(`common.voice.language.${languageItem?.value.replace('-', '')}`) : localLanguagePlaceholder} @@ -103,7 +103,7 @@ const VoiceParamConfig = ({ aria-hidden="true" /> - + - {languages.map((item: Item) => ( - `relative cursor-pointer select-none py-2 pl-3 pr-9 rounded-lg hover:bg-gray-100 text-gray-700 ${active ? 'bg-gray-100' : '' @@ -133,14 +133,14 @@ const VoiceParamConfig = ({ 'absolute inset-y-0 right-0 flex items-center pr-4 text-gray-700', )} > - + ))} - +
@@ -160,7 +160,7 @@ const VoiceParamConfig = ({ }} >
- {voiceItem?.name ?? localVoicePlaceholder} @@ -170,7 +170,7 @@ const VoiceParamConfig = ({ aria-hidden="true" /> - + - {voiceItems?.map((item: Item) => ( - `relative cursor-pointer select-none py-2 pl-3 pr-9 rounded-lg hover:bg-gray-100 text-gray-700 ${active ? 'bg-gray-100' : '' @@ -199,14 +199,14 @@ const VoiceParamConfig = ({ 'absolute inset-y-0 right-0 flex items-center pr-4 text-gray-700', )} > - + ))} - +
diff --git a/web/app/components/base/fullscreen-modal/index.tsx b/web/app/components/base/fullscreen-modal/index.tsx index 752a91cecc..9a76dfa62b 100644 --- a/web/app/components/base/fullscreen-modal/index.tsx +++ b/web/app/components/base/fullscreen-modal/index.tsx @@ -1,4 +1,4 @@ -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition } from '@headlessui/react' import { Fragment } from 'react' import { RiCloseLargeLine } from '@remixicon/react' import classNames from '@/utils/classnames' @@ -27,7 +27,7 @@ export default function FullScreenModal({ return ( -
- + */} + {/* TODO: to new Transition */} +
- -
} {children} - - + + */} + {/* TODO: to new Transition */} + + {closable + &&
{ + e.stopPropagation() + onClose() + }}> + +
} + {children} +
diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsx index a659ccaac7..4d586add57 100644 --- a/web/app/components/base/modal/index.tsx +++ b/web/app/components/base/modal/index.tsx @@ -1,4 +1,4 @@ -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, DialogTitle, Transition } from '@headlessui/react' import { Fragment } from 'react' import { RiCloseLine } from '@remixicon/react' import classNames from '@/utils/classnames' @@ -30,7 +30,7 @@ export default function Modal({ return ( -
- + */} + {/* TODO: to new Transition */} +
- - - {title && {title} - } - {description && + } + {description &&
{description} - } +
} {closable &&
} {children} -
-
+ + */} + {/* TODO: to new Transition */} + + {title && + {title} + } + {description &&
+ {description} +
} + {closable + &&
+ { + e.stopPropagation() + onClose() + } + } /> +
} + {children} +
diff --git a/web/app/components/base/notion-page-selector/workspace-selector/index.tsx b/web/app/components/base/notion-page-selector/workspace-selector/index.tsx index 66227d4f4d..39171a02c6 100644 --- a/web/app/components/base/notion-page-selector/workspace-selector/index.tsx +++ b/web/app/components/base/notion-page-selector/workspace-selector/index.tsx @@ -1,7 +1,7 @@ 'use client' import { useTranslation } from 'react-i18next' import { Fragment } from 'react' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import NotionIcon from '../../notion-icon' import s from './index.module.css' import cn from '@/utils/classnames' @@ -25,7 +25,7 @@ export default function WorkspaceSelector({ { ({ open }) => ( <> - + {currentWorkspace?.workspace_name}
{currentWorkspace?.pages.length}
- + - { items.map(item => ( - +
onSelect(item.workspace_id)} @@ -70,11 +70,11 @@ export default function WorkspaceSelector({ {item.pages.length} {t('common.dataSource.notion.selector.pageSelected')}
- + )) }
- +
) diff --git a/web/app/components/base/popover/index.tsx b/web/app/components/base/popover/index.tsx index f510c21642..13090abe0b 100644 --- a/web/app/components/base/popover/index.tsx +++ b/web/app/components/base/popover/index.tsx @@ -1,4 +1,4 @@ -import { Popover, Transition } from '@headlessui/react' +import { Popover, PopoverButton, PopoverPanel, Transition } from '@headlessui/react' import { Fragment, cloneElement, useRef } from 'react' import cn from '@/utils/classnames' @@ -59,7 +59,7 @@ export default function CustomPopover({ onMouseEnter: () => onMouseEnter(open), })} > - {btnElement} - + - )} - +
diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index 9ad964f79d..6a99fd3f76 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -1,7 +1,7 @@ 'use client' import type { FC } from 'react' import React, { Fragment, useEffect, useState } from 'react' -import { Combobox, Listbox, Transition } from '@headlessui/react' +import { Combobox, ComboboxButton, ComboboxInput, ComboboxOption, ComboboxOptions, Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from '@headlessui/react' import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/20/solid' import Badge from '../badge/index' import { RiCheckLine } from '@remixicon/react' @@ -101,7 +101,7 @@ const Select: FC = ({
{allowSearch - ? { if (!disabled) @@ -109,28 +109,28 @@ const Select: FC = ({ }} displayValue={(item: Item) => item?.name} /> - : { if (!disabled) setOpen(!open) } } className={classNames(`flex items-center h-9 w-full rounded-lg border-0 ${bgClassName} py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-state-base-hover group-hover:bg-state-base-hover`, optionClassName)}>
{selectedItem?.name}
-
} - } + { if (!disabled) setOpen(!open) } }> {open ? : } - +
{(filteredItems.length > 0 && open) && ( - + {filteredItems.map((item: Item) => ( - @@ -161,9 +161,9 @@ const Select: FC = ({ )} )} - + ))} - + )}
@@ -210,9 +210,9 @@ const SimpleSelect: FC = ({ }} >
- {renderTrigger && {renderTrigger(selectedItem)}} + {renderTrigger && {renderTrigger(selectedItem)}} {!renderTrigger && ( - + {selectedItem?.name ?? localPlaceholder} {(selectedItem && !notClearable) @@ -234,7 +234,7 @@ const SimpleSelect: FC = ({ /> )} - + )} {!disabled && ( @@ -245,9 +245,9 @@ const SimpleSelect: FC = ({ leaveTo="opacity-0" > - + {items.map((item: Item) => ( - classNames( @@ -276,9 +276,9 @@ const SimpleSelect: FC = ({ )} )} - + ))} - + )}
diff --git a/web/app/components/base/select/locale.tsx b/web/app/components/base/select/locale.tsx index 8b89c66950..b7b2d5cbbf 100644 --- a/web/app/components/base/select/locale.tsx +++ b/web/app/components/base/select/locale.tsx @@ -1,7 +1,8 @@ 'use client' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import { Fragment } from 'react' import { GlobeAltIcon } from '@heroicons/react/24/outline' +import cn from '@/utils/classnames' type ISelectProps = { items: Array<{ value: string; name: string }> @@ -21,14 +22,14 @@ export default function Select({
- +
- +
{items.map((item) => { - return + return {({ active }) => ( )} - + })}
-
+
@@ -77,9 +77,9 @@ export function InputSelect({
- + {item?.name} - +
- +
{items.map((item) => { - return + return {({ active }) => ( )} - + })}
-
+
diff --git a/web/app/components/develop/code.tsx b/web/app/components/develop/code.tsx index 7716cd4c93..1c9e2b57f3 100644 --- a/web/app/components/develop/code.tsx +++ b/web/app/components/develop/code.tsx @@ -7,7 +7,7 @@ import { useRef, useState, } from 'react' -import { Tab } from '@headlessui/react' +import { Tab, TabGroup, TabList, TabPanel, TabPanels } from '@headlessui/react' import { Tag } from './tag' import classNames from '@/utils/classnames' import { writeTextToClipboard } from '@/utils/clipboard' @@ -162,7 +162,7 @@ function CodeGroupHeader({ title, children, selectedIndex }: IChildrenProps) { )} {hasTabs && ( - + {Children.map(children, (child, childIndex) => ( ))} - + )}
) @@ -190,13 +190,13 @@ function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsPro if (hasTabs) { return ( - + {Children.map(children, child => ( - + {child} - + ))} - + ) } @@ -261,7 +261,7 @@ export function CodeGroup({ children, title, inputs, targetCode, ...props }: ICh ) const tabGroupProps = useTabGroupProps(languages) const hasTabs = Children.count(children) > 1 - const Container = hasTabs ? Tab.Group : 'div' + const Container = hasTabs ? TabGroup : 'div' const containerProps = hasTabs ? tabGroupProps : {} const headerProps = hasTabs ? { selectedIndex: tabGroupProps.selectedIndex } diff --git a/web/app/components/header/account-dropdown/index.tsx b/web/app/components/header/account-dropdown/index.tsx index f176058332..faa0c8588e 100644 --- a/web/app/components/header/account-dropdown/index.tsx +++ b/web/app/components/header/account-dropdown/index.tsx @@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation' import { useContext } from 'use-context-selector' import { RiArrowDownSLine, RiLogoutBoxRLine } from '@remixicon/react' import Link from 'next/link' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import Indicator from '../indicator' import AccountAbout from '../account-about' import { mailToSupport } from '../utils/util' @@ -58,7 +58,7 @@ export default function AppSelector({ isMobile }: IAppSelector) { { ({ open }) => ( <> - } - + - - +
@@ -97,9 +97,9 @@ export default function AppSelector({ isMobile }: IAppSelector) {
{userProfile.email}
-
+
- + {({ active }) => {t('common.account.account')}
} - - + + {({ active }) =>
setShowAccountSettingModal({ payload: 'members' })}>
{t('common.userProfile.settings')}
} -
- {canEmailSupport && + + {canEmailSupport && {({ active }) => {t('common.userProfile.emailSupport')} } - } - + } + {({ active }) => {t('common.userProfile.communityFeedback')} } - - + + {({ active }) => {t('common.userProfile.community')} } - - + + {({ active }) => {t('common.userProfile.helpCenter')} } - - + + {({ active }) => {t('common.userProfile.roadmap')} } - + { document?.body?.getAttribute('data-public-site-about') !== 'hide' && ( - + {({ active }) =>
setAboutVisible(true)}> @@ -186,11 +186,11 @@ export default function AppSelector({ isMobile }: IAppSelector) {
} -
+ ) } - + {({ active }) =>
handleLogout()}>
} -
-
+ +
) diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.tsx b/web/app/components/header/account-dropdown/workplace-selector/index.tsx index f8bde33d51..750b18957e 100644 --- a/web/app/components/header/account-dropdown/workplace-selector/index.tsx +++ b/web/app/components/header/account-dropdown/workplace-selector/index.tsx @@ -1,7 +1,7 @@ import { Fragment } from 'react' import { useContext } from 'use-context-selector' import { useTranslation } from 'react-i18next' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react' import { RiArrowDownSLine } from '@remixicon/react' import cn from '@/utils/classnames' import { switchWorkspace } from '@/service/common' @@ -35,7 +35,7 @@ const WorkplaceSelector = () => { { ({ open }) => ( <> - {
{currentWorkspace?.name}
-
+ { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - { )) } - + ) diff --git a/web/app/components/header/account-setting/data-source-page/data-source-notion/operate/index.tsx b/web/app/components/header/account-setting/data-source-page/data-source-notion/operate/index.tsx index c6c8b9ec39..f4790e52e2 100644 --- a/web/app/components/header/account-setting/data-source-page/data-source-notion/operate/index.tsx +++ b/web/app/components/header/account-setting/data-source-page/data-source-notion/operate/index.tsx @@ -8,7 +8,7 @@ import { RiMoreFill, RiStickyNoteAddLine, } from '@remixicon/react' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import { syncDataSourceNotion, updateDataSourceNotionAction } from '@/service/common' import Toast from '@/app/components/base/toast' @@ -54,9 +54,9 @@ export default function Operate({ { ({ open }) => ( <> - + - + -
- +
- - + +
{t('common.dataSource.notion.sync')}
-
+ - +
{t('common.dataSource.notion.remove')}
-
-
+ +
) diff --git a/web/app/components/header/account-setting/members-page/operation/index.tsx b/web/app/components/header/account-setting/members-page/operation/index.tsx index 82867ec522..232c30776d 100644 --- a/web/app/components/header/account-setting/members-page/operation/index.tsx +++ b/web/app/components/header/account-setting/members-page/operation/index.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next' import { Fragment, useMemo } from 'react' import { useContext } from 'use-context-selector' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import { CheckIcon, ChevronDownIcon } from '@heroicons/react/24/outline' import s from './index.module.css' import { useProviderContext } from '@/context/provider-context' @@ -90,7 +90,7 @@ const Operation = ({ { ({ open }) => ( <> - {RoleMap[member.role] || RoleMap.normal} - + - { roleList.map(role => ( - +
handleUpdateMemberRole(role)}> { role === member.role @@ -133,11 +133,11 @@ const Operation = ({
{t(`common.members.${toHump(role)}Tip`)}
-
+ )) } - +
@@ -147,8 +147,8 @@ const Operation = ({
-
-
+ +
) diff --git a/web/app/components/header/account-setting/menu-dialog.tsx b/web/app/components/header/account-setting/menu-dialog.tsx index 76296b84dd..c6e1fd8ba8 100644 --- a/web/app/components/header/account-setting/menu-dialog.tsx +++ b/web/app/components/header/account-setting/menu-dialog.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback, useEffect } from 'react' import type { ReactNode } from 'react' -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition } from '@headlessui/react' import cn from '@/utils/classnames' type DialogProps = { @@ -32,10 +32,10 @@ const MenuDialog = ({ return ( - {}}> + { }}>
- - +
{children} - - + + */} + {/* TODO: to new Transition */} + +
+ {children} +
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx index e93c6636b5..e86b032bb0 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx +++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx @@ -1,6 +1,6 @@ import { Fragment } from 'react' import type { FC } from 'react' -import { Popover, Transition } from '@headlessui/react' +import { Popover, PopoverButton, PopoverPanel, Transition } from '@headlessui/react' import { useTranslation } from 'react-i18next' import { RiCheckLine, @@ -32,7 +32,7 @@ const Selector: FC = ({ return ( - + { ({ open }) => ( ) } - + - +
{t('common.modelProvider.card.priorityUse')}
{ options.map(option => ( - +
onSelect(option.key)} @@ -63,11 +63,11 @@ const Selector: FC = ({
{option.text}
{value === option.key && }
-
+ )) }
-
+
) diff --git a/web/app/components/header/app-selector/index.tsx b/web/app/components/header/app-selector/index.tsx index 38451f2605..9e5e902cde 100644 --- a/web/app/components/header/app-selector/index.tsx +++ b/web/app/components/header/app-selector/index.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next' import { Fragment, useState } from 'react' import { ChevronDownIcon, PlusIcon } from '@heroicons/react/24/solid' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import { useRouter } from 'next/navigation' import Indicator from '../indicator' import type { AppDetailResponse } from '@/models/app' @@ -30,7 +30,7 @@ export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {
- +
- { appItems.map((app: AppDetailResponse) => ( - +
router.push(`/app/${app.id}/${isCurrentWorkspaceEditor ? 'configuration' : 'overview'}`) }> @@ -75,11 +75,11 @@ export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {
{app.name}
- + )) } )} - {isCurrentWorkspaceEditor && + {isCurrentWorkspaceEditor &&
setShowNewAppDialog(true)}>
{t('common.menus.newApp')}
-
+ } - +
setShowNewAppDialog(false)} - onSuccess={() => {}} + onSuccess={() => { }} /> ) diff --git a/web/app/components/header/nav/nav-selector/index.tsx b/web/app/components/header/nav/nav-selector/index.tsx index ba9c58fadb..a0b97da76b 100644 --- a/web/app/components/header/nav/nav-selector/index.tsx +++ b/web/app/components/header/nav/nav-selector/index.tsx @@ -6,7 +6,7 @@ import { RiArrowDownSLine, RiArrowRightSLine, } from '@remixicon/react' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import { useRouter } from 'next/navigation' import { debounce } from 'lodash-es' import cn from '@/utils/classnames' @@ -57,7 +57,7 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }: {({ open }) => ( <> - @@ -66,8 +66,8 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }: className={cn('shrink-0 w-3 h-3 ml-1 opacity-50 group-hover:opacity-100', open && '!opacity-100')} aria-hidden="true" /> - - + { navs.map(nav => ( - +
{ if (curNav?.id === nav.id) return @@ -85,7 +85,7 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }: router.push(nav.link) }} title={nav.name}>
- + {!!nav.mode && (
- + )) }
{!isApp && isCurrentWorkspaceEditor && ( - +
onCreate('')} className={cn( 'flex items-center gap-2 px-3 py-[6px] rounded-lg cursor-pointer hover:bg-gray-100', )}> @@ -126,13 +126,13 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
{createText}
-
+ )} {isApp && isCurrentWorkspaceEditor && ( {({ open }) => ( <> - +
{createText}
-
+ -
@@ -172,13 +172,13 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }: {t('app.importDSL')}
-
+
)}
)} -
+ )}