Skip to content

Commit

Permalink
fix(InlineCloseButton): use semantic button
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChristophe committed Sep 18, 2023
1 parent e2df48d commit 4bbc078
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions components/InlineCloseButton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.unstyledButton {
border: none;
background: none;
}
10 changes: 5 additions & 5 deletions components/InlineCloseButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type FC } from 'react';
import { X } from 'react-bootstrap-icons';
import actionable from 'styles/actionable.module.css';
import styles from './InlineCloseButton.module.scss';
import clsx from 'clsx';

type InlineCloseButtonProps = { onClose: () => void };
Expand All @@ -14,13 +14,13 @@ type InlineCloseButtonProps = { onClose: () => void };
* @param props.onClose callback to call when button is pressed
*/
const InlineCloseButton: FC<InlineCloseButtonProps> = ({ onClose }) => (
<div
<button
onClick={() => onClose()}
className={clsx('d-inline-block', actionable['actionable'])}
role="button"
className={clsx('d-inline-block', styles['unstyledButton'])}
type="button"
>
<X />
</div>
</button>
);

export default InlineCloseButton;

0 comments on commit 4bbc078

Please sign in to comment.