Change to absolute

This commit is contained in:
mickr777 2023-06-02 14:59:10 +10:00 committed by GitHub
parent 8ae1eaaccc
commit 2bdb655375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,38 +45,52 @@ export default function InvokeButton(props: InvokeButton) {
return (
<Box style={{ flexGrow: 4 }} position="relative">
{iconButton ? (
<IAIIconButton
aria-label={t('parameters.invoke')}
type="submit"
icon={<FaPlay />}
isDisabled={!isReady}
onClick={handleInvoke}
flexGrow={1}
w="100%"
tooltip={t('parameters.invoke')}
tooltipProps={{ placement: 'bottom' }}
colorScheme="accent"
id="invoke-button"
{...rest}
/>
) : (
<IAIButton
aria-label={t('parameters.invoke')}
type="submit"
isDisabled={!isReady}
onClick={handleInvoke}
flexGrow={1}
w="100%"
colorScheme="accent"
id="invoke-button"
fontWeight={700}
{...rest}
>
Invoke
</IAIButton>
)}
{!isReady && <ProgressBar />}
<Box style={{ position: 'relative' }}>
{iconButton ? (
<IAIIconButton
aria-label={t('parameters.invoke')}
type="submit"
icon={<FaPlay />}
isDisabled={!isReady}
onClick={handleInvoke}
flexGrow={1}
w="100%"
tooltip={t('parameters.invoke')}
tooltipProps={{ placement: 'bottom' }}
colorScheme="accent"
id="invoke-button"
{...rest}
/>
) : (
<IAIButton
aria-label={t('parameters.invoke')}
type="submit"
isDisabled={!isReady}
onClick={handleInvoke}
flexGrow={1}
w="100%"
colorScheme="accent"
id="invoke-button"
fontWeight={700}
{...rest}
>
Invoke
</IAIButton>
)}
{!isReady && (
<Box
style={{
position: 'absolute',
bottom: '0',
left: '0',
right: '0',
zIndex: 1,
}}
>
<ProgressBar />
</Box>
)}
</Box>
</Box>
);
}