diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-25 18:33:22 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:15:27 +0100 |
| commit | 9aeb82269d7c74c4566b7ca254782a4dfbd69a6e (patch) | |
| tree | e2ab930204cbcf20cebaa6125ea022f050d973af /src/components/organisms/layout/site-footer.tsx | |
| parent | c21a137e1991af1331fe5768fc6bac15ea9230b1 (diff) | |
refactor(components): remove SiteHeader and SiteFooter components
They do not help to make the layout more readable (on the contrary I
think...) so the props drilling is useless.
Diffstat (limited to 'src/components/organisms/layout/site-footer.tsx')
| -rw-r--r-- | src/components/organisms/layout/site-footer.tsx | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/src/components/organisms/layout/site-footer.tsx b/src/components/organisms/layout/site-footer.tsx deleted file mode 100644 index ccab051..0000000 --- a/src/components/organisms/layout/site-footer.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import type { FC, ReactNode } from 'react'; -import { useIntl } from 'react-intl'; -import { Footer } from '../../atoms'; -import { - BackToTop, - type BackToTopProps, - Colophon, - type ColophonLink, - type CopyrightProps, - Copyright, -} from '../../molecules'; -import styles from './site-footer.module.scss'; - -export type SiteFooterProps = { - /** - * Set additional classnames to the back to top button. - */ - backToTopClassName?: BackToTopProps['className']; - /** - * Set additional classnames to the footer element. - */ - className?: string; - /** - * Set the copyright information. - */ - copyright: CopyrightProps; - /** - * The website license. - */ - license?: ReactNode; - /** - * The footer nav items. - */ - navItems?: ColophonLink[]; - /** - * An element id (without hashtag) used as anchor for back to top button. - */ - topId: string; -}; - -/** - * SiteFooter component - * - * Renders a footer with copyright and nav; - */ -export const SiteFooter: FC<SiteFooterProps> = ({ - backToTopClassName, - className = '', - copyright, - license, - navItems, - topId, -}) => { - const intl = useIntl(); - const backToTop = intl.formatMessage({ - defaultMessage: 'Back to top', - description: 'SiteFooter: an accessible name for the back to top button', - id: 'OHvb01', - }); - const backToTopAnchor = `#${topId}`; - const footerClass = `${styles.wrapper} ${className}`; - const btnClass = `${styles['back-to-top']} ${backToTopClassName}`; - - return ( - <Footer className={footerClass}> - <Colophon - copyright={<Copyright {...copyright} />} - license={license} - links={navItems} - /> - <BackToTop - anchor={backToTopAnchor} - className={btnClass} - label={backToTop} - /> - </Footer> - ); -}; |
