diff --git a/web/app/components/plugins/plugin-page/index.tsx b/web/app/components/plugins/plugin-page/index.tsx index 10050617b4..c3dce36371 100644 --- a/web/app/components/plugins/plugin-page/index.tsx +++ b/web/app/components/plugins/plugin-page/index.tsx @@ -2,13 +2,11 @@ import type { Dependency, PluginDeclaration, PluginManifestInMarket } from '../types' import { - RiBookOpenLine, RiDragDropLine, RiEqualizer2Line, } from '@remixicon/react' import { useBoolean } from 'ahooks' import { noop } from 'es-toolkit/function' -import Link from 'next/link' import { useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' @@ -17,12 +15,10 @@ import Tooltip from '@/app/components/base/tooltip' import ReferenceSettingModal from '@/app/components/plugins/reference-setting-modal' import { MARKETPLACE_API_PREFIX, SUPPORT_INSTALL_LOCAL_FILE_EXTENSIONS } from '@/config' import { useGlobalPublicStore } from '@/context/global-public-context' -import { useDocLink } from '@/context/i18n' import useDocumentTitle from '@/hooks/use-document-title' import { usePluginInstallation } from '@/hooks/use-query-params' import { fetchBundleInfoFromMarketPlace, fetchManifestFromMarketPlace } from '@/service/plugins' import { sleep } from '@/utils' -import { cn } from '@/utils/classnames' import { PLUGIN_PAGE_TABS_MAP } from '../hooks' import InstallFromLocalPackage from '../install-plugin/install-from-local-package' import InstallFromMarketplace from '../install-plugin/install-from-marketplace' @@ -35,6 +31,7 @@ import { import DebugInfo from './debug-info' import InstallPluginDropdown from './install-plugin-dropdown' import PluginTasks from './plugin-tasks' +import SubmitRequestDropdown from './submit-request-dropdown' import useReferenceSetting from './use-reference-setting' import { useUploader } from './use-uploader' @@ -47,7 +44,6 @@ const PluginPage = ({ marketplace, }: PluginPageProps) => { const { t } = useTranslation() - const docLink = useDocLink() useDocumentTitle(t('metadata.title', { ns: 'plugin' })) // Use nuqs hook for installation state @@ -154,36 +150,7 @@ const PluginPage = ({ {!isPluginsTab && }
- { - isExploringMarketplace && ( - <> - - - - - - -
- - ) - } + {isExploringMarketplace && } {canManagement && ( void +} + +const DropdownItem = ({ href, icon, text, onClick }: DropdownItemProps) => ( + + {icon} + {text} + +) + +const SubmitRequestDropdown = () => { + const { t } = useTranslation() + const [open, setOpen] = useState(false) + const docLink = useDocLink() + + return ( + + setOpen(v => !v)}> + + + +
+ } + text={t('requestAPlugin', { ns: 'plugin' })} + onClick={() => setOpen(false)} + /> + } + text={t('publishPlugins', { ns: 'plugin' })} + onClick={() => setOpen(false)} + /> +
+
+
+ ) +} + +export default SubmitRequestDropdown diff --git a/web/i18n/en-US/plugin.json b/web/i18n/en-US/plugin.json index b66893022a..8ed9732586 100644 --- a/web/i18n/en-US/plugin.json +++ b/web/i18n/en-US/plugin.json @@ -240,6 +240,7 @@ "readmeInfo.noReadmeAvailable": "No README available", "readmeInfo.title": "README", "requestAPlugin": "Request a plugin", + "requestSubmitPlugin": "Request / Submit", "search": "Search", "searchCategories": "Search Categories", "searchInMarketplace": "Search in Marketplace", diff --git a/web/i18n/zh-Hans/plugin.json b/web/i18n/zh-Hans/plugin.json index c97744fd33..d0f9a113d4 100644 --- a/web/i18n/zh-Hans/plugin.json +++ b/web/i18n/zh-Hans/plugin.json @@ -240,6 +240,7 @@ "readmeInfo.noReadmeAvailable": "README 文档不可用", "readmeInfo.title": "README", "requestAPlugin": "申请插件", + "requestSubmitPlugin": "申请并发布插件", "search": "搜索", "searchCategories": "搜索类别", "searchInMarketplace": "在 Marketplace 中搜索",