diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-08 19:41:40 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-08 19:41:40 +0200 |
| commit | a5df28fad0dae266a857ae110c43b3cb8b23c996 (patch) | |
| tree | a32ea390e90697dc51c3ccb9018de9da2ee4fac3 /src/components/atoms/links/social-link.tsx | |
| parent | 5c75a302c2203cb3ebf31233121026b4775662cf (diff) | |
refactor: use a consistent classname prop and avoid children prop
I was using the FunctionComponent type for some component that do not
use children. So I change the type to VoidFunctionComponent to avoid
mistakes.
I also rename all the "classes" or "additionalClasses" props to
"className" to keep consistency between each components.
Diffstat (limited to 'src/components/atoms/links/social-link.tsx')
| -rw-r--r-- | src/components/atoms/links/social-link.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/atoms/links/social-link.tsx b/src/components/atoms/links/social-link.tsx index 489c8b4..8c7c790 100644 --- a/src/components/atoms/links/social-link.tsx +++ b/src/components/atoms/links/social-link.tsx @@ -2,14 +2,16 @@ import GithubIcon from '@assets/images/social-media/github.svg'; import GitlabIcon from '@assets/images/social-media/gitlab.svg'; import LinkedInIcon from '@assets/images/social-media/linkedin.svg'; import TwitterIcon from '@assets/images/social-media/twitter.svg'; -import { FC } from 'react'; +import { VFC } from 'react'; import styles from './social-link.module.scss'; -type SocialLinkProps = { +export type SocialWebsite = 'Github' | 'Gitlab' | 'LinkedIn' | 'Twitter'; + +export type SocialLinkProps = { /** * The social website name. */ - name: 'Github' | 'Gitlab' | 'LinkedIn' | 'Twitter'; + name: SocialWebsite; /** * The social profile url. */ @@ -21,7 +23,7 @@ type SocialLinkProps = { * * Render a social icon link. */ -const SocialLink: FC<SocialLinkProps> = ({ name, url }) => { +const SocialLink: VFC<SocialLinkProps> = ({ name, url }) => { /** * Retrieve a social link icon by id. * @param {string} id - The social website id. |
