Skip to content

Commit

Permalink
💄 [open-formulieren/open-forms#4717] Using button element for the Mod…
Browse files Browse the repository at this point in the history
…al close button
  • Loading branch information
robinmolen committed Oct 2, 2024
1 parent ee809c9 commit b4d570c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/modals/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {createContext, useContext, useEffect} from 'react';
import {useIntl} from 'react-intl';
import ReactModal from 'react-modal';

import {OFButton} from 'components/Button';
import FAIcon from 'components/FAIcon';
import {getBEMClassName} from 'utils';

Expand Down Expand Up @@ -46,21 +47,21 @@ const Modal = ({
>
<header className={getBEMClassName('react-modal__header')}>
{title ? <Title className={getBEMClassName('react-modal__title')}>{title}</Title> : null}
<FAIcon
icon="close"
extraClassName={getBEMClassName('react-modal__close')}
<OFButton
appearance="subtle-button"
onClick={closeModal}
className={getBEMClassName('react-modal__close')}
title={intl.formatMessage({
description: 'Modal close icon title',
defaultMessage: 'Close',
})}
onClick={closeModal}
noAriaHidden
role="button"
aria-label={intl.formatMessage({
description: 'Modal close icon title',
defaultMessage: 'Close',
})}
/>
>
<FAIcon icon="close" />
</OFButton>
</header>
{children}
</ReactModal>
Expand Down

0 comments on commit b4d570c

Please sign in to comment.