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