diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-27 17:38:23 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-10-24 12:25:00 +0200 |
| commit | 7255d25f6834a208c0ed44636356cc260f6ab6ba (patch) | |
| tree | 88016a958190f766a3ac0ab4b77f4732e17502e8 /src/components/molecules/layout/branding.tsx | |
| parent | ba793e043e4d8515b1a9ea490ee2c5f92b1fd6c2 (diff) | |
refactor(components): rewrite Heading component
* remove `alignment` and `withMargin` props (consumer should handle
that)
* move styles to Sass placeholders to avoid repeats with headings
coming from WordPress
* refactor some other components that depend on Heading to avoid ESlint
errors
Diffstat (limited to 'src/components/molecules/layout/branding.tsx')
| -rw-r--r-- | src/components/molecules/layout/branding.tsx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/components/molecules/layout/branding.tsx b/src/components/molecules/layout/branding.tsx index b105796..981da74 100644 --- a/src/components/molecules/layout/branding.tsx +++ b/src/components/molecules/layout/branding.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { FC, useRef } from 'react'; +import { type FC, useRef } from 'react'; import { useIntl } from 'react-intl'; import { useStyles } from '../../../utils/hooks'; import { Heading } from '../../atoms'; @@ -90,7 +90,6 @@ export const Branding: FC<BrandingProps> = ({ className={styles.title} isFake={!isHome} level={1} - withMargin={false} ref={titleRef} > {withLink ? ( @@ -101,17 +100,11 @@ export const Branding: FC<BrandingProps> = ({ title )} </Heading> - {baseline && ( - <Heading - className={styles.baseline} - isFake={true} - level={4} - withMargin={false} - ref={baselineRef} - > + {baseline ? ( + <Heading className={styles.baseline} isFake level={4} ref={baselineRef}> {baseline} </Heading> - )} + ) : null} </div> ); }; |
