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

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

Loading…
Cancel
Save