mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 11:06:46 +08:00
fix: Get marketplace URL with specific function, preserving all search params.
This commit is contained in:
parent
3113350e51
commit
384570ebfa
@ -6,9 +6,9 @@ import Item from './item'
|
|||||||
import type { Plugin } from '@/app/components/plugins/types.ts'
|
import type { Plugin } from '@/app/components/plugins/types.ts'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { MARKETPLACE_URL_PREFIX } from '@/config'
|
|
||||||
import { RiArrowRightUpLine, RiSearchLine } from '@remixicon/react'
|
import { RiArrowRightUpLine, RiSearchLine } from '@remixicon/react'
|
||||||
import { noop } from 'lodash-es'
|
import { noop } from 'lodash-es'
|
||||||
|
import { getMarketplaceUrl } from '@/utils/var'
|
||||||
|
|
||||||
export type ListProps = {
|
export type ListProps = {
|
||||||
wrapElemRef: React.RefObject<HTMLElement>
|
wrapElemRef: React.RefObject<HTMLElement>
|
||||||
@ -32,7 +32,7 @@ const List = forwardRef<ListRef, ListProps>(({
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const hasFilter = !searchText
|
const hasFilter = !searchText
|
||||||
const hasRes = list.length > 0
|
const hasRes = list.length > 0
|
||||||
const urlWithSearchText = `${MARKETPLACE_URL_PREFIX}/?q=${searchText}&tags=${tags.join(',')}`
|
const urlWithSearchText = getMarketplaceUrl('', { q: searchText, tags: tags.join(',') })
|
||||||
const nextToStickyELemRef = useRef<HTMLDivElement>(null)
|
const nextToStickyELemRef = useRef<HTMLDivElement>(null)
|
||||||
|
|
||||||
const { handleScroll, scrollPosition } = useStickyScroll({
|
const { handleScroll, scrollPosition } = useStickyScroll({
|
||||||
@ -71,7 +71,7 @@ const List = forwardRef<ListRef, ListProps>(({
|
|||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
className='system-sm-medium sticky bottom-0 z-10 flex h-8 cursor-pointer items-center rounded-b-lg border-[0.5px] border-t border-components-panel-border bg-components-panel-bg-blur px-4 py-1 text-text-accent-light-mode-only shadow-lg'
|
className='system-sm-medium sticky bottom-0 z-10 flex h-8 cursor-pointer items-center rounded-b-lg border-[0.5px] border-t border-components-panel-border bg-components-panel-bg-blur px-4 py-1 text-text-accent-light-mode-only shadow-lg'
|
||||||
href={`${MARKETPLACE_URL_PREFIX}/`}
|
href={getMarketplaceUrl('')}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
<span>{t('plugin.findMoreInMarketplace')}</span>
|
<span>{t('plugin.findMoreInMarketplace')}</span>
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { pluginManifestToCardPluginProps } from '@/app/components/plugins/instal
|
|||||||
import { Badge as Badge2, BadgeState } from '@/app/components/base/badge/index'
|
import { Badge as Badge2, BadgeState } from '@/app/components/base/badge/index'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { MARKETPLACE_URL_PREFIX } from '@/config'
|
import { getMarketplaceUrl } from '@/utils/var'
|
||||||
|
|
||||||
export type SwitchPluginVersionProps = {
|
export type SwitchPluginVersionProps = {
|
||||||
uniqueIdentifier: string
|
uniqueIdentifier: string
|
||||||
@ -82,7 +82,7 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
|
|||||||
modalBottomLeft={
|
modalBottomLeft={
|
||||||
<Link
|
<Link
|
||||||
className='flex items-center justify-center gap-1'
|
className='flex items-center justify-center gap-1'
|
||||||
href={`${MARKETPLACE_URL_PREFIX}/plugins/${pluginDetail.declaration.author}/${pluginDetail.declaration.name}`}
|
href={getMarketplaceUrl(`/plugins/${pluginDetail.declaration.author}/${pluginDetail.declaration.name}`)}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
<span className='system-xs-regular text-xs text-text-accent'>
|
<span className='system-xs-regular text-xs text-text-accent'>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user