fix: github link

pull/12372/head
JzoNg 2 years ago
parent 42a0534299
commit 3efc6c5050

@ -79,6 +79,14 @@ const DetailHeader = ({
return false return false
}, [isFromMarketplace, latest_version, version]) }, [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, { const [isShowUpdateModal, {
setTrue: showUpdateModal, setTrue: showUpdateModal,
setFalse: hideUpdateModal, setFalse: hideUpdateModal,
@ -229,7 +237,7 @@ const DetailHeader = ({
onInfo={showPluginInfo} onInfo={showPluginInfo}
onCheckVersion={handleUpdate} onCheckVersion={handleUpdate}
onRemove={showDeleteConfirm} onRemove={showDeleteConfirm}
detailUrl={`${MARKETPLACE_URL_PREFIX}/plugins/${author}/${name}`} detailUrl={detailUrl}
/> />
<ActionButton onClick={onHide}> <ActionButton onClick={onHide}>
<RiCloseLine className='w-4 h-4' /> <RiCloseLine className='w-4 h-4' />

@ -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' 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> >{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'> <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> <span className='grow'>{t('plugin.detailPanel.operation.viewDetail')}</span>
<RiArrowRightUpLine className='shrink-0 w-3.5 h-3.5 text-text-tertiary' /> <RiArrowRightUpLine className='shrink-0 w-3.5 h-3.5 text-text-tertiary' />

Loading…
Cancel
Save