Fix/plugin badge i18n (#14319)

This commit is contained in:
zxhlyh 2025-02-25 16:35:10 +08:00 committed by GitHub
parent b44b3866a1
commit 8c08153e33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,4 @@
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import IconWithTooltip from './icon-with-tooltip'
import PartnerDark from '@/app/components/base/icons/src/public/plugins/PartnerDark'
import PartnerLight from '@/app/components/base/icons/src/public/plugins/PartnerLight'
@ -7,12 +6,13 @@ import useTheme from '@/hooks/use-theme'
type PartnerProps = {
className?: string
text: string
}
const Partner: FC<PartnerProps> = ({
className,
text,
}) => {
const { t } = useTranslation()
const { theme } = useTheme()
return (
@ -21,7 +21,7 @@ const Partner: FC<PartnerProps> = ({
theme={theme}
BadgeIconLight={PartnerLight}
BadgeIconDark={PartnerDark}
popupContent={t('plugin.marketplace.partnerTip')}
popupContent={text}
/>
)
}

View File

@ -1,5 +1,4 @@
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import IconWithTooltip from './icon-with-tooltip'
import VerifiedDark from '@/app/components/base/icons/src/public/plugins/VerifiedDark'
import VerifiedLight from '@/app/components/base/icons/src/public/plugins/VerifiedLight'
@ -7,12 +6,13 @@ import useTheme from '@/hooks/use-theme'
type VerifiedProps = {
className?: string
text: string
}
const Verified: FC<VerifiedProps> = ({
className,
text,
}) => {
const { t } = useTranslation()
const { theme } = useTheme()
return (
@ -21,7 +21,7 @@ const Verified: FC<VerifiedProps> = ({
theme={theme}
BadgeIconLight={VerifiedLight}
BadgeIconDark={VerifiedDark}
popupContent={t('plugin.marketplace.verifiedTip')}
popupContent={text}
/>
)
}

View File

@ -73,8 +73,8 @@ const Card = ({
<div className="ml-3 w-0 grow">
<div className="flex items-center h-5">
<Title title={getLocalizedText(label)} />
{isPartner && <Partner className='w-4 h-4 ml-0.5' />}
{verified && <Verified className='w-4 h-4 ml-0.5' />}
{isPartner && <Partner className='w-4 h-4 ml-0.5' text={t('plugin.marketplace.partnerTip')} />}
{verified && <Verified className='w-4 h-4 ml-0.5' text={t('plugin.marketplace.verifiedTip')} />}
{titleLeft} {/* This can be version badge */}
</div>
<OrgInfo