From 3272ac336da52364ace5ed76d8f609d4088ffc06 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 28 Sep 2023 18:19:00 +0200 Subject: refactor(components): make Logo component ESlint compliant I also renamed the title prop to heading because title already exists as HTML attribute. --- src/components/atoms/images/logo/logo.tsx | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/components/atoms/images/logo/logo.tsx (limited to 'src/components/atoms/images/logo/logo.tsx') diff --git a/src/components/atoms/images/logo/logo.tsx b/src/components/atoms/images/logo/logo.tsx new file mode 100644 index 0000000..5c575a5 --- /dev/null +++ b/src/components/atoms/images/logo/logo.tsx @@ -0,0 +1,46 @@ +/* eslint-disable react/jsx-no-literals */ +import type { FC, SVGAttributes } from 'react'; +import styles from './logo.module.scss'; + +export type LogoProps = Omit, 'role'> & { + /** + * Define an accessible title for the logo. + */ + heading?: string; +}; + +/** + * Logo component. + * + * Render a SVG logo. + */ +export const Logo: FC = ({ heading, ...props }) => ( + // eslint-disable-next-line jsx-a11y/prefer-tag-over-role -- Valid on SVG + + {heading ? {heading} : null} + + + + + + + +); -- cgit v1.2.3