Skip to content

Commit

Permalink
IconButton: make onClick required & fix modal close issue
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvuerings committed Mar 26, 2024
1 parent 9ecadcb commit 919355c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-rice-repair.md
@@ -0,0 +1,5 @@
---
"@cambly/syntax-core": minor
---

IconButton: make onClick required & fix modal close issue
2 changes: 1 addition & 1 deletion packages/syntax-core/src/IconButton/IconButton.tsx
Expand Up @@ -98,7 +98,7 @@ type IconButtonProps = {
/**
* The callback to be called when the button is clicked
*/
onClick?: React.MouseEventHandler<HTMLButtonElement>;
onClick: React.MouseEventHandler<HTMLButtonElement>;
/**
* The tooltip to be displayed when the user hovers over the button
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/syntax-core/src/Modal/Modal.tsx
Expand Up @@ -215,13 +215,14 @@ export default function Modal({
accessibilityLabel={accessibilityCloseLabel}
color={image ? "primary" : "tertiary"}
on={image ? "darkBackground" : "lightBackground"}
onClick={onDismiss}
size="sm"
icon={XIconCambio}
/>
</Box>
)}
</Box>
{image && <Box maxHeight={200}>{image}</Box>}
{image && <Box>{image}</Box>}
<Box
display="flex"
gap={themeName === "classic" ? 3 : 4}
Expand Down

0 comments on commit 919355c

Please sign in to comment.