fix: marketplace link

This commit is contained in:
StyleZhang 2024-11-15 16:32:49 +08:00
parent 5ea306850e
commit 746838e276
2 changed files with 6 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import Button from '@/app/components/base/button'
import { useMixedTranslation } from '@/app/components/plugins/marketplace/hooks' import { useMixedTranslation } from '@/app/components/plugins/marketplace/hooks'
import InstallFromMarketplace from '@/app/components/plugins/install-plugin/install-from-marketplace' import InstallFromMarketplace from '@/app/components/plugins/install-plugin/install-from-marketplace'
import { useBoolean } from 'ahooks' import { useBoolean } from 'ahooks'
import { useI18N } from '@/context/i18n'
type CardWrapperProps = { type CardWrapperProps = {
plugin: Plugin plugin: Plugin
@ -24,6 +25,7 @@ const CardWrapper = ({
setTrue: showInstallFromMarketplace, setTrue: showInstallFromMarketplace,
setFalse: hideInstallFromMarketplace, setFalse: hideInstallFromMarketplace,
}] = useBoolean(false) }] = useBoolean(false)
const { locale: localeFromLocale } = useI18N()
if (showInstallButton) { if (showInstallButton) {
return ( return (
@ -54,7 +56,7 @@ const CardWrapper = ({
<Button <Button
className='flex-1' className='flex-1'
> >
<a href={`${MARKETPLACE_URL_PREFIX}/plugin/${plugin.org}/${plugin.name}`} target='_blank' className='flex items-center gap-0.5'> <a href={`${MARKETPLACE_URL_PREFIX}/plugin/${plugin.org}/${plugin.name}?language=${localeFromLocale}`} target='_blank' className='flex items-center gap-0.5'>
{t('plugin.detailPanel.operation.detail')} {t('plugin.detailPanel.operation.detail')}
<RiArrowRightUpLine className='ml-1 w-4 h-4' /> <RiArrowRightUpLine className='ml-1 w-4 h-4' />
</a> </a>
@ -105,7 +107,7 @@ const CardWrapper = ({
<Button <Button
className='flex-1' className='flex-1'
> >
<a href={`${MARKETPLACE_URL_PREFIX}/plugin/${plugin.org}/${plugin.name}`} target='_blank' className='flex items-center gap-0.5'> <a href={`${MARKETPLACE_URL_PREFIX}/plugins/${plugin.org}/${plugin.name}`} target='_blank' className='flex items-center gap-0.5'>
{t('plugin.detailPanel.operation.detail')} {t('plugin.detailPanel.operation.detail')}
<RiArrowRightUpLine className='ml-1 w-4 h-4' /> <RiArrowRightUpLine className='ml-1 w-4 h-4' />
</a> </a>

View File

@ -29,7 +29,7 @@ const Marketplace = ({
} = useMarketplace(searchPluginText, filterPluginTags) } = useMarketplace(searchPluginText, filterPluginTags)
return ( return (
<div className='flex flex-col shrink-0 sticky -bottom-[442px] h-[530px] overflow-y-auto px-12 py-2 pt-0 bg-background-default-subtle'> <div className='flex flex-col shrink-0 sticky bottom-[-442px] h-[530px] overflow-y-auto px-12 py-2 pt-0 bg-background-default-subtle'>
<RiArrowUpDoubleLine <RiArrowUpDoubleLine
className='absolute top-2 left-1/2 -translate-x-1/2 w-4 h-4 text-text-quaternary cursor-pointer' className='absolute top-2 left-1/2 -translate-x-1/2 w-4 h-4 text-text-quaternary cursor-pointer'
onClick={() => onMarketplaceScroll()} onClick={() => onMarketplaceScroll()}
@ -57,7 +57,7 @@ const Marketplace = ({
</span> </span>
{t('common.operation.in')} {t('common.operation.in')}
<a <a
href={`${MARKETPLACE_URL_PREFIX}`} href={`${MARKETPLACE_URL_PREFIX}?language=${locale}`}
className='flex items-center ml-1 system-sm-medium text-text-accent' className='flex items-center ml-1 system-sm-medium text-text-accent'
target='_blank' target='_blank'
> >