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/forms/flipping-label.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/forms/flipping-label.tsx')
| -rw-r--r-- | src/components/molecules/forms/flipping-label.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/components/molecules/forms/flipping-label.tsx b/src/components/molecules/forms/flipping-label.tsx index ca83c6d..c85642b 100644 --- a/src/components/molecules/forms/flipping-label.tsx +++ b/src/components/molecules/forms/flipping-label.tsx @@ -1,6 +1,5 @@ import { FC } from 'react'; -import Label, { LabelProps } from '../../atoms/forms/label'; -import Close from '../../atoms/icons/close'; +import { Close, Label, type LabelProps } from '../../atoms'; import styles from './flipping-label.module.scss'; export type FlippingLabelProps = Pick< @@ -17,7 +16,7 @@ export type FlippingLabelProps = Pick< isActive: boolean; }; -const FlippingLabel: FC<FlippingLabelProps> = ({ +export const FlippingLabel: FC<FlippingLabelProps> = ({ children, className = '', isActive, @@ -26,7 +25,7 @@ const FlippingLabel: FC<FlippingLabelProps> = ({ const wrapperModifier = isActive ? 'wrapper--active' : 'wrapper--inactive'; return ( - <Label className={`${styles.label} ${className}`} {...props}> + <Label {...props} className={`${styles.label} ${className}`}> <span className={`${styles.wrapper} ${styles[wrapperModifier]}`}> <span className={styles.front}>{children}</span> <span className={styles.back}> @@ -36,5 +35,3 @@ const FlippingLabel: FC<FlippingLabelProps> = ({ </Label> ); }; - -export default FlippingLabel; |
