setDismiss(false)}>
{/* Specify a key to force the component to re-render and thus recalculate useSwipeToDismissProps when the alert changes. Otherwise the alert gets stuck off screen in the dismiss state. */}
- {
ref={popupRef}
key={value}
data-testid='alert-content'
+ onClose={onClose}
+ closeButtonSize='sm'
>
{renderedIcon}
{value}
-
+
) : null}
diff --git a/src/components/CloseButton.tsx b/src/components/CloseButton.tsx
index d3381de182..cfd15298cf 100644
--- a/src/components/CloseButton.tsx
+++ b/src/components/CloseButton.tsx
@@ -4,23 +4,28 @@ import { upperRightRecipe } from '../../styled-system/recipes'
import fastClick from '../util/fastClick'
/** A close button with an ✕. */
-const CloseButton = ({ onClose, disableSwipeToDismiss }: { onClose: () => void; disableSwipeToDismiss?: boolean }) => {
+const CloseButton = ({
+ onClose,
+ disableSwipeToDismiss,
+ size = 'md',
+}: {
+ onClose: () => void
+ disableSwipeToDismiss?: boolean
+ size?: 'sm' | 'md'
+}) => {
const fontSize = useSelector(state => state.fontSize)
- const padding = fontSize / 2 + 2
+ const padding = (fontSize / 2 + 2) / (size === 'sm' ? 2 : 1)
return (