fix: github link

This commit is contained in:
JzoNg 2024-11-21 13:42:06 +08:00
parent 42a0534299
commit 3efc6c5050
2 changed files with 10 additions and 2 deletions

View File

@ -79,6 +79,14 @@ const DetailHeader = ({
return false
}, [isFromMarketplace, latest_version, version])
const detailUrl = useMemo(() => {
if (isFromGitHub)
return `https://github.com/${meta!.repo}`
if (isFromMarketplace)
return `${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}`
return ''
}, [author, isFromGitHub, isFromMarketplace, meta, name])
const [isShowUpdateModal, {
setTrue: showUpdateModal,
setFalse: hideUpdateModal,
@ -229,7 +237,7 @@ const DetailHeader = ({
onInfo={showPluginInfo}
onCheckVersion={handleUpdate}
onRemove={showDeleteConfirm}
detailUrl={`${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}`}
detailUrl={detailUrl}
/>
<ActionButton onClick={onHide}>
<RiCloseLine className='w-4 h-4' />

View File

@ -77,7 +77,7 @@ const OperationDropdown: FC<Props> = ({
className='px-3 py-1.5 rounded-lg text-text-secondary system-md-regular cursor-pointer hover:bg-state-base-hover'
>{t('plugin.detailPanel.operation.checkUpdate')}</div>
)}
{source === PluginSource.marketplace && (
{(source === PluginSource.marketplace || source === PluginSource.github) && (
<a href={detailUrl} target='_blank' className='flex items-center px-3 py-1.5 rounded-lg text-text-secondary system-md-regular cursor-pointer hover:bg-state-base-hover'>
<span className='grow'>{t('plugin.detailPanel.operation.viewDetail')}</span>
<RiArrowRightUpLine className='shrink-0 w-3.5 h-3.5 text-text-tertiary' />