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/layout/branding.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/layout/branding.tsx')
| -rw-r--r-- | src/components/molecules/layout/branding.tsx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/components/molecules/layout/branding.tsx b/src/components/molecules/layout/branding.tsx index 10574ab..b105796 100644 --- a/src/components/molecules/layout/branding.tsx +++ b/src/components/molecules/layout/branding.tsx @@ -1,9 +1,9 @@ import Link from 'next/link'; import { FC, useRef } from 'react'; import { useIntl } from 'react-intl'; -import useStyles from '../../../utils/hooks/use-styles'; -import Heading from '../../atoms/headings/heading'; -import FlippingLogo, { type FlippingLogoProps } from '../images/flipping-logo'; +import { useStyles } from '../../../utils/hooks'; +import { Heading } from '../../atoms'; +import { FlippingLogo, type FlippingLogoProps } from '../images'; import styles from './branding.module.scss'; export type BrandingProps = Pick<FlippingLogoProps, 'photo'> & { @@ -30,7 +30,7 @@ export type BrandingProps = Pick<FlippingLogoProps, 'photo'> & { * * Render the branding logo, title and optional baseline. */ -const Branding: FC<BrandingProps> = ({ +export const Branding: FC<BrandingProps> = ({ baseline, isHome = false, photo, @@ -79,18 +79,18 @@ const Branding: FC<BrandingProps> = ({ return ( <div className={styles.wrapper}> <FlippingLogo - className={styles.logo} + {...props} altText={altText} + className={styles.logo} logoTitle={logoTitle} photo={photo} ref={logoRef} - {...props} /> <Heading + className={styles.title} isFake={!isHome} level={1} withMargin={false} - className={styles.title} ref={titleRef} > {withLink ? ( @@ -103,10 +103,10 @@ const Branding: FC<BrandingProps> = ({ </Heading> {baseline && ( <Heading + className={styles.baseline} isFake={true} level={4} withMargin={false} - className={styles.baseline} ref={baselineRef} > {baseline} @@ -115,5 +115,3 @@ const Branding: FC<BrandingProps> = ({ </div> ); }; - -export default Branding; |
