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
commit 2c5f5b0c67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 9 deletions

View file

@ -1,4 +1,5 @@
'use client'
import { useTheme } from 'next-themes'
import { RiArrowRightUpLine } from '@remixicon/react'
import { getPluginLinkInMarketplace } from '../utils'
import Card from '@/app/components/plugins/card'
@ -22,6 +23,7 @@ const CardWrapper = ({
locale,
}: CardWrapperProps) => {
const { t } = useMixedTranslation(locale)
const { theme } = useTheme()
const [isShowInstallFromMarketplace, {
setTrue: showInstallFromMarketplace,
setFalse: hideInstallFromMarketplace,
@ -54,7 +56,7 @@ const CardWrapper = ({
>
{t('plugin.detailPanel.operation.install')}
</Button>
<a href={`${getPluginLinkInMarketplace(plugin)}?language=${localeFromLocale}`} target='_blank' className='block w-[calc(50%-4px)] flex-1 shrink-0'>
<a href={`${getPluginLinkInMarketplace(plugin)}?language=${localeFromLocale}${theme ? `&theme=${theme}` : ''}`} target='_blank' className='block w-[calc(50%-4px)] flex-1 shrink-0'>
<Button
className='w-full gap-0.5'
>