Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/proud-suits-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Do not render the footer in AlertDialog if all button props are falsy'
26 changes: 14 additions & 12 deletions src/components/overlays/AlertDialog/AlertDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,22 @@ function AlertDialog(props: CubeAlertDialogProps, ref) {
)}
</Content>
) : null}
{!noActions ? (
{!noActions || (!confirmProps && !secondaryProps && !cancelProps) ? (
<Footer>
<ButtonGroup align="end">
<Button
autoFocus
theme={danger ? 'danger' : undefined}
{...confirmProps}
onPress={(e) =>
chain(
(confirmProps as CubeButtonProps)?.onPress?.(e),
onClose?.('confirm'),
)
}
/>
{confirmProps && (
<Button
autoFocus
theme={danger ? 'danger' : undefined}
{...confirmProps}
onPress={(e) =>
chain(
(confirmProps as CubeButtonProps)?.onPress?.(e),
onClose?.('confirm'),
)
}
/>
)}
{secondaryProps && (
<Button
{...secondaryProps}
Expand Down
Loading