Feat: add search params with theme in links of marketplace (#19648)

This commit is contained in:
KVOJJJin
2025-05-14 13:46:03 +08:00
committed by GitHub
parent 9dce0e40b5
commit 2c5f5b0c67
7 changed files with 22 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
'use client'
import type { FC } from 'react'
import React, { useMemo } from 'react'
import { useTheme } from 'next-themes'
import {
RiArrowRightUpLine,
RiBugLine,
@@ -38,6 +39,7 @@ const PluginItem: FC<Props> = ({
plugin,
}) => {
const { t } = useTranslation()
const { theme } = useTheme()
const { categoriesMap } = useSingleCategories()
const currentPluginID = usePluginPageContext(v => v.currentPluginID)
const setCurrentPluginID = usePluginPageContext(v => v.setCurrentPluginID)
@@ -164,7 +166,7 @@ const PluginItem: FC<Props> = ({
}
{source === PluginSource.marketplace
&& <>
<a href={`${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}`} target='_blank' className='flex items-center gap-0.5'>
<a href={`${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}${theme ? `?theme=${theme}` : ''}`} target='_blank' className='flex items-center gap-0.5'>
<div className='system-2xs-medium-uppercase text-text-tertiary'>{t('plugin.from')} <span className='text-text-secondary'>marketplace</span></div>
<RiArrowRightUpLine className='h-3 w-3 text-text-tertiary' />
</a>