1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

refactor: avoid usage of React.FC to use JSX.Element (to stay consistent)

This commit is contained in:
2023-08-01 17:22:09 +02:00
parent 4b2e7bae90
commit 2e0138194c
34 changed files with 51 additions and 37 deletions

View File

@ -1,6 +1,6 @@
import { getI18n } from '@/i18n/i18n.server'
export const ProfileDescriptionBottom: React.FC = () => {
export const ProfileDescriptionBottom = (): JSX.Element => {
const i18n = getI18n()
return (

View File

@ -1,6 +1,6 @@
import { getI18n } from '@/i18n/i18n.server'
export const ProfileInformation: React.FC = () => {
export const ProfileInformation = (): JSX.Element => {
const i18n = getI18n()
return (

View File

@ -4,7 +4,7 @@ interface ProfileItemProps {
link?: string
}
export const ProfileItem: React.FC<ProfileItemProps> = (props) => {
export const ProfileItem = (props: ProfileItemProps): JSX.Element => {
const { title, value, link } = props
return (

View File

@ -2,7 +2,7 @@ import Image from 'next/image'
import Logo from 'public/images/logo.png'
export const ProfileLogo: React.FC = () => {
export const ProfileLogo = (): JSX.Element => {
return (
<div className='max-h-[370px] max-w-[370px] px-2 py-6'>
<Image quality={100} src={Logo} alt='Théo LUDWIG' priority />

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const EmailIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const EmailIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>Email</title>

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const GitHubIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const GitHubIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>GitHub</title>

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const GitLabIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const GitLabIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>GitLab</title>

View File

@ -1,6 +1,6 @@
import classNames from 'clsx'
export const Icon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const Icon = (props: React.SVGProps<SVGSVGElement>): JSX.Element => {
const { children, className, ...rest } = props
return (

View File

@ -1,6 +1,6 @@
import { Icon } from './Icon'
export const NPMIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const NPMIcon = (props: React.SVGProps<SVGSVGElement>): JSX.Element => {
return (
<Icon {...props}>
<title>npm</title>

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const TwitchIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const TwitchIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>Twitch</title>

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const TwitterIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const TwitterIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>Twitter</title>

View File

@ -1,6 +1,8 @@
import { Icon } from './Icon'
export const YouTubeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
export const YouTubeIcon = (
props: React.SVGProps<SVGSVGElement>
): JSX.Element => {
return (
<Icon {...props}>
<title>YouTube</title>

View File

@ -1,11 +1,9 @@
interface SocialMediaItemProps {
interface SocialMediaItemProps extends React.PropsWithChildren {
link: string
ariaLabel: string
}
export const SocialMediaItem: React.FC<
React.PropsWithChildren<SocialMediaItemProps>
> = (props) => {
export const SocialMediaItem = (props: SocialMediaItemProps): JSX.Element => {
const { link, ariaLabel, children } = props
return (

View File

@ -7,7 +7,7 @@ import { TwitchIcon } from './SocialMediaIcons/TwitchIcon'
import { EmailIcon } from './SocialMediaIcons/EmailIcon'
import { NPMIcon } from './SocialMediaIcons/NPMIcon'
export const SocialMediaList: React.FC = () => {
export const SocialMediaList = (): JSX.Element => {
return (
<ul className='social-media-list m-0 mt-2 list-none py-4 text-center'>
<SocialMediaItem link='https://github.com/theoludwig' ariaLabel='GitHub'>

View File

@ -5,7 +5,7 @@ import { ProfileInformation } from './ProfileInfo'
import { ProfileList } from './ProfileList'
import { ProfileLogo } from './ProfileLogo'
export const Profile: React.FC = () => {
export const Profile = (): JSX.Element => {
const cookiesStore = cookies()
return (