mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-12-08 00:44:30 +01:00
refactor: 'use client' when appropriate
This commit is contained in:
parent
70603f1444
commit
6d0dcb50a7
@ -1,3 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import { useCallback, useEffect, useState, useRef } from 'react'
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import setLanguage from 'next-translate/setLanguage'
|
||||
@ -61,7 +63,7 @@ export const Language: React.FC = () => {
|
||||
>
|
||||
{i18n.locales.map((language, index) => {
|
||||
if (language === currentLanguage) {
|
||||
return null
|
||||
return <></>
|
||||
}
|
||||
return (
|
||||
<li
|
||||
|
@ -1,3 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import classNames from 'clsx'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ShadowContainer } from 'components/design/ShadowContainer'
|
||||
import { GitHubIcon } from 'components/Profile/SocialMediaList/SocialMediaIcons/GitHubIcon'
|
||||
import { ShadowContainer } from '@/components/design/ShadowContainer'
|
||||
import { GitHubIcon } from '@/components/Profile/SocialMediaList/SocialMediaIcons/GitHubIcon'
|
||||
|
||||
export interface RepositoryProps {
|
||||
name: string
|
||||
|
@ -11,7 +11,7 @@ export const OpenSource: React.FC = () => {
|
||||
<div className='my-6 grid grid-cols-1 gap-6 md:w-10/12 md:grid-cols-2'>
|
||||
<Repository
|
||||
name='nodejs/node'
|
||||
description='Node.js JavaScript runtime 🐢🚀'
|
||||
description='Node.js JavaScript runtime ✨🐢🚀✨'
|
||||
href='https://github.com/nodejs/node/commits?author=theoludwig'
|
||||
/>
|
||||
<Repository
|
||||
@ -21,12 +21,12 @@ export const OpenSource: React.FC = () => {
|
||||
/>
|
||||
<Repository
|
||||
name='nrwl/nx'
|
||||
description='Smart, Extensible Build Framework'
|
||||
description='Smart, Fast and Extensible Build System'
|
||||
href='https://github.com/nrwl/nx/commits?author=theoludwig'
|
||||
/>
|
||||
<Repository
|
||||
name='vercel/next.js'
|
||||
description='The React Framework for Production'
|
||||
description='The React Framework'
|
||||
href='https://github.com/vercel/next.js/commits?author=theoludwig'
|
||||
/>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Image from 'next/image'
|
||||
|
||||
import { ShadowContainer } from 'components/design/ShadowContainer'
|
||||
import { ShadowContainer } from '@/components/design/ShadowContainer'
|
||||
|
||||
export interface PortfolioItemProps {
|
||||
title: string
|
||||
|
@ -1,7 +1,9 @@
|
||||
'use client'
|
||||
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
import { BIRTH_DATE, BIRTH_DATE_STRING, getAge } from 'utils/getAge'
|
||||
import { BIRTH_DATE, BIRTH_DATE_STRING, getAge } from '@/utils/getAge'
|
||||
|
||||
import { ProfileItem } from './ProfileItem'
|
||||
|
||||
|
@ -16,7 +16,7 @@ export const SocialMediaList: React.FC = () => {
|
||||
<SocialMediaItem link='https://gitlab.com/theoludwig' ariaLabel='GitLab'>
|
||||
<GitLabIcon />
|
||||
</SocialMediaItem>
|
||||
<SocialMediaItem link='https://www.npmjs.com/~theoludwig' ariaLabel='NPM'>
|
||||
<SocialMediaItem link='https://www.npmjs.com/~theoludwig' ariaLabel='npm'>
|
||||
<NPMIcon />
|
||||
</SocialMediaItem>
|
||||
<SocialMediaItem
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ShadowContainer } from 'components/design/ShadowContainer'
|
||||
import { ShadowContainer } from '@/components/design/ShadowContainer'
|
||||
|
||||
export interface SkillsSectionProps {
|
||||
title: string
|
||||
|
@ -1,3 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useRef } from 'react'
|
||||
|
||||
export const RevealFade: React.FC<React.PropsWithChildren> = (props) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ShadowContainer } from '../ShadowContainer'
|
||||
import { SectionHeading } from './SectionHeading'
|
||||
import { ShadowContainer } from '@/components/design/ShadowContainer'
|
||||
import { SectionHeading } from '@/components/design/Section/SectionHeading'
|
||||
|
||||
type SectionProps = React.ComponentPropsWithRef<'section'> & {
|
||||
heading?: string
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { getAge } from '../../../utils/getAge'
|
||||
import { getAge } from '@/utils/getAge'
|
||||
|
||||
describe('utils/getAge', () => {
|
||||
it('should calculate the right age of a person', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user