chore: support install hide button

pull/12372/head
Joel 1 year ago
parent d4cda69b0e
commit 99942b26e6

@ -15,6 +15,7 @@ type Props = {
onInstalled: (plugins: Plugin[], installStatus: InstallStatusResponse[]) => void
onCancel: () => void
isFromMarketPlace?: boolean
isHideButton?: boolean
}
const Install: FC<Props> = ({
@ -22,6 +23,7 @@ const Install: FC<Props> = ({
onInstalled,
onCancel,
isFromMarketPlace,
isHideButton,
}) => {
const { t } = useTranslation()
const [selectedPlugins, setSelectedPlugins] = React.useState<Plugin[]>([])
@ -82,6 +84,7 @@ const Install: FC<Props> = ({
</div>
</div>
{/* Action Buttons */}
{!isHideButton && (
<div className='flex p-6 pt-5 justify-end items-center gap-2 self-stretch'>
{!canInstall && (
<Button variant='secondary' className='min-w-[72px]' onClick={onCancel}>
@ -98,6 +101,8 @@ const Install: FC<Props> = ({
<span>{t(`${i18nPrefix}.${isInstalling ? 'installing' : 'install'}`)}</span>
</Button>
</div>
)}
</>
)
}

@ -13,12 +13,14 @@ type Props = {
list: Plugin[]
installStatus: InstallStatusResponse[]
onCancel: () => void
isHideButton?: boolean
}
const Installed: FC<Props> = ({
list,
installStatus,
onCancel,
isHideButton,
}) => {
const { t } = useTranslation()
const { getIconUrl } = useGetIcon()
@ -45,6 +47,7 @@ const Installed: FC<Props> = ({
</div>
</div>
{/* Action Buttons */}
{!isHideButton && (
<div className='flex p-6 pt-5 justify-end items-center gap-2 self-stretch'>
<Button
variant='primary'
@ -54,6 +57,7 @@ const Installed: FC<Props> = ({
{t('common.operation.close')}
</Button>
</div>
)}
</>
)
}

Loading…
Cancel
Save