mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
chore: render button only if primary or secondary button is used
This commit is contained in:
@@ -167,7 +167,15 @@ const ConfirmationModal = ({
|
|||||||
|
|
||||||
{children && <div className='w-full'>{children}</div>}
|
{children && <div className='w-full'>{children}</div>}
|
||||||
|
|
||||||
<div className='w-full grid grid-cols-2 gap-3'>
|
{(secondaryButton || primaryButton) && (
|
||||||
|
<div
|
||||||
|
className={cn('w-full grid gap-3', {
|
||||||
|
'grid-cols-2': secondaryButton && primaryButton,
|
||||||
|
'grid-cols-1':
|
||||||
|
(secondaryButton && !primaryButton) ||
|
||||||
|
(!secondaryButton && primaryButton),
|
||||||
|
})}
|
||||||
|
>
|
||||||
{secondaryButton && secondaryButton.text && (
|
{secondaryButton && secondaryButton.text && (
|
||||||
<Button
|
<Button
|
||||||
{...secondaryButton}
|
{...secondaryButton}
|
||||||
@@ -204,12 +212,16 @@ const ConfirmationModal = ({
|
|||||||
? primaryButton?.isLoading
|
? primaryButton?.isLoading
|
||||||
: isPrimaryButtonLoading
|
: isPrimaryButtonLoading
|
||||||
}
|
}
|
||||||
className={cn('p-2 rounded-xl text-sm', primaryButton?.className)}
|
className={cn(
|
||||||
|
'p-2 rounded-xl text-sm',
|
||||||
|
primaryButton?.className
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{primaryButton?.text ?? 'Ya'}
|
{primaryButton?.text ?? 'Ya'}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user