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,4 +1,5 @@
import React, { useCallback, useMemo, useState } from 'react'
import { useTheme } from 'next-themes'
import { useTranslation } from 'react-i18next'
import { useBoolean } from 'ahooks'
import {
@@ -49,6 +50,7 @@ const DetailHeader = ({
onUpdate,
}: Props) => {
const { t } = useTranslation()
const { theme } = useTheme()
const locale = useGetLanguage()
const { checkForUpdates, fetchReleases } = useGitHubReleases()
const { setShowUpdatePluginModal } = useModalContext()
@@ -85,9 +87,9 @@ const DetailHeader = ({
if (isFromGitHub)
return `https://github.com/${meta!.repo}`
if (isFromMarketplace)
return `${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}`
return `${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}${theme ? `?theme=${theme}` : ''}`
return ''
}, [author, isFromGitHub, isFromMarketplace, meta, name])
}, [author, isFromGitHub, isFromMarketplace, meta, name, theme])
const [isShowUpdateModal, {
setTrue: showUpdateModal,