click handle of provider card

pull/12372/head
JzoNg 2 years ago
parent f257184b00
commit 96c3ec91af

@ -1,5 +1,6 @@
'use client' 'use client'
import { RiArrowRightUpLine } from '@remixicon/react' import { RiArrowRightUpLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import Card from '@/app/components/plugins/card' import Card from '@/app/components/plugins/card'
import CardMoreInfo from '@/app/components/plugins/card/card-more-info' import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
import type { Plugin } from '@/app/components/plugins/types' import type { Plugin } from '@/app/components/plugins/types'
@ -14,6 +15,7 @@ const CardWrapper = ({
plugin, plugin,
showInstallButton, showInstallButton,
}: CardWrapperProps) => { }: CardWrapperProps) => {
const { t } = useTranslation()
return ( return (
<div className='group relative rounded-xl cursor-pointer'> <div className='group relative rounded-xl cursor-pointer'>
<Card <Card
@ -33,14 +35,15 @@ const CardWrapper = ({
variant='primary' variant='primary'
className='flex-1' className='flex-1'
> >
Install {t('plugin.detailPanel.operation.install')}
</Button> </Button>
<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> <a href={`${MARKETPLACE_URL_PREFIX}/plugin/${plugin.org}/${plugin.name}`} target='_blank' className='flex items-center gap-0.5'>
Details {t('plugin.detailPanel.operation.detail')}
<RiArrowRightUpLine className='ml-1 w-4 h-4' /> <RiArrowRightUpLine className='ml-1 w-4 h-4' />
</a>
</Button> </Button>
</div> </div>
) )

@ -1,6 +1,7 @@
'use client' 'use client'
import React from 'react' import React from 'react'
import type { FC } from 'react' import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { RiArrowRightUpLine, RiVerifiedBadgeLine } from '@remixicon/react' import { RiArrowRightUpLine, RiVerifiedBadgeLine } from '@remixicon/react'
import Badge from '../base/badge' import Badge from '../base/badge'
import type { Plugin } from './types' import type { Plugin } from './types'
@ -22,6 +23,7 @@ const ProviderCard: FC<Props> = ({
className, className,
payload, payload,
}) => { }) => {
const { t } = useTranslation()
const language = useGetLanguage() const language = useGetLanguage()
const { org, label } = payload const { org, label } = payload
@ -57,14 +59,14 @@ const ProviderCard: FC<Props> = ({
className='flex-grow' className='flex-grow'
variant='primary' variant='primary'
> >
Install {t('plugin.detailPanel.operation.install')}
</Button> </Button>
<Button <Button
className='flex-grow' className='flex-grow'
variant='secondary' variant='secondary'
> >
<a href={`${MARKETPLACE_URL_PREFIX}/plugin/${payload.org}/${payload.name}`} target='_blank' className='flex items-center gap-0.5'> <a href={`${MARKETPLACE_URL_PREFIX}/plugin/${payload.org}/${payload.name}`} target='_blank' className='flex items-center gap-0.5'>
Details {t('plugin.detailPanel.operation.detail')}
<RiArrowRightUpLine className='w-4 h-4' /> <RiArrowRightUpLine className='w-4 h-4' />
</a> </a>
</Button> </Button>

@ -13,7 +13,7 @@ const translation = {
}, },
operation: { operation: {
install: 'Install', install: 'Install',
detail: 'Detail', detail: 'Details',
update: 'Update', update: 'Update',
info: 'Plugin Info', info: 'Plugin Info',
checkUpdate: 'Check Update', checkUpdate: 'Check Update',

Loading…
Cancel
Save