diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-20 16:38:54 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-09-20 16:38:54 +0200 |
| commit | f861e6a269ba9f62700776d3cd13b644a9e836d4 (patch) | |
| tree | a5a107e7a6e4ff8b4261fe04349357bc00b783ee /src/components/molecules/buttons/heading-button.tsx | |
| parent | 03331c44276ec56e9f235e4d5ee75030455a753f (diff) | |
refactor: use named export for everything except pages
Next expect a default export for pages so only those components should
use default exports. Everything else should use named exports to
reduce the number of import statements.
Diffstat (limited to 'src/components/molecules/buttons/heading-button.tsx')
| -rw-r--r-- | src/components/molecules/buttons/heading-button.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/components/molecules/buttons/heading-button.tsx b/src/components/molecules/buttons/heading-button.tsx index cefd179..93ccdbe 100644 --- a/src/components/molecules/buttons/heading-button.tsx +++ b/src/components/molecules/buttons/heading-button.tsx @@ -1,7 +1,6 @@ import { FC, SetStateAction } from 'react'; import { useIntl } from 'react-intl'; -import Heading, { type HeadingProps } from '../../atoms/headings/heading'; -import PlusMinus from '../../atoms/icons/plus-minus'; +import { Heading, type HeadingProps, PlusMinus } from '../../atoms'; import styles from './heading-button.module.scss'; export type HeadingButtonProps = Pick<HeadingProps, 'level'> & { @@ -28,7 +27,7 @@ export type HeadingButtonProps = Pick<HeadingProps, 'level'> & { * * Render a button as accordion title to toggle body. */ -const HeadingButton: FC<HeadingButtonProps> = ({ +export const HeadingButton: FC<HeadingButtonProps> = ({ className = '', expanded, level, @@ -51,9 +50,9 @@ const HeadingButton: FC<HeadingButtonProps> = ({ return ( <button - type="button" className={`${styles.wrapper} ${className}`} onClick={() => setExpanded(!expanded)} + type="button" > <Heading level={level} withMargin={false} className={styles.heading}> <span className="screen-reader-text">{titlePrefix} </span> @@ -63,5 +62,3 @@ const HeadingButton: FC<HeadingButtonProps> = ({ </button> ); }; - -export default HeadingButton; |
