Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore / Language #7

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'react-refresh/only-export-components': 'off',
'react/prop-types': 'off',
'react/jsx-no-target-blank': [2, { allowReferrer: false }]
Expand Down
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"css": "src/app/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
Expand Down
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import createNextIntlPlugin from 'next-intl/plugin'

const withNextIntl = createNextIntlPlugin()

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
formats: ['image/avif', 'image/webp']
}
}

export default nextConfig
export default withNextIntl(nextConfig)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"geist": "^1.3.1",
"lucide-react": "^0.331.0",
"next": "14.1.0",
"next-intl": "^3.17.4",
"next-themes": "^0.3.0",
"next-view-transitions": "^0.1.1",
"react": "^18.3.1",
Expand All @@ -49,7 +50,7 @@
"eslint-plugin-promise": "^6.6.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-react-refresh": "^0.4.10",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
Expand Down
93 changes: 88 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/assets/page-not-found.webm
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
5 changes: 5 additions & 0 deletions src/app/[locale]/[...rest]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { notFound } from 'next/navigation'

export default function CatchAllPage() {
notFound()
}
File renamed without changes.
File renamed without changes.
57 changes: 33 additions & 24 deletions src/app/layout.tsx → src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@ import { Toaster } from '@/components/ui/sonner'
import { Toaster as ToasterProvider } from '@/components/ui/toaster'
import { Analytics } from '@vercel/analytics/react'
import { SpeedInsights } from '@vercel/speed-insights/next'
import { NextIntlClientProvider } from 'next-intl'
import { getMessages } from 'next-intl/server'
import { type Locale } from '@/i18n'
import { cn } from '@/lib/utils'
import './globals.css'
import '../styles/globals.css'

const metadata: Metadata = {
title: 'Portfolio | Emanuel Peire',
description: 'My personal portfolio: showcasing my work and skills.'
}

export default function RootLayout({
children
export default async function RootLayout({
children,
params: { locale }
}: {
children: React.ReactNode
params: { locale: Locale }
}) {
const messages = await getMessages()

return (
<html
lang='en'
lang={locale}
className={cn(
'min-h-screen bg-background font-sans antialiased overflow-y-scroll',
GeistSans.variable,
Expand All @@ -37,26 +44,28 @@ export default function RootLayout({
>
<Head metadata={metadata} />
<body className='w-full'>
<ViewTransitions>
<ThemeProvider
attribute='class'
defaultTheme='system'
enableSystem
disableTransitionOnChange
>
<TooltipProvider>
<main className='flex flex-col items-center justify-center min-h-screen pt-24 pb-8 px-4'>
<Header />
{children}
<Footer />
</main>
</TooltipProvider>
<Toaster />
<ToasterProvider />
</ThemeProvider>
<Analytics />
<SpeedInsights />
</ViewTransitions>
<NextIntlClientProvider messages={messages}>
<ViewTransitions>
<ThemeProvider
attribute='class'
defaultTheme='system'
enableSystem
disableTransitionOnChange
>
<TooltipProvider>
<main className='flex flex-col items-center justify-center min-h-screen pt-24 pb-8 px-4'>
<Header />
{children}
<Footer />
</main>
</TooltipProvider>
<Toaster />
<ToasterProvider />
</ThemeProvider>
<Analytics />
<SpeedInsights />
</ViewTransitions>
</NextIntlClientProvider>
</body>
</html>
)
Expand Down
38 changes: 38 additions & 0 deletions src/app/[locale]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useTranslations } from 'next-intl'
import { Link } from 'next-view-transitions'

export default function NotFoundPage() {
const t = useTranslations()

return (
<>
<video
autoPlay
loop
muted
className='absolute left-0 top-0 h-full w-full object-cover'
>
<source src='/assets/page-not-found.webm' type='video/webm' />
</video>
<div className='not-found absolute left-0 top-0 h-full w-full dark:bg-black bg-white opacity-90' />

<div className='z-10 flex flex-col items-center'>
<h1 className='flex items-center gap-x-4 text-balance text-5xl font-bold dark:text-white text-black'>
{t('not-found.title')}
</h1>
<p className='mx-auto max-w-3xl pt-4 font-mono text-center dark:text-neutral-200 text-neutral-800 md:mb-4'>
{t('not-found.description')}
</p>

<div className='flex flex-wrap items-center pt-2 md:pt-0'>
<Link
className='dark:text-white text-black hover:underline hover:underline-offset-4'
href='/'
>
{t('not-found.button')}
</Link>
</div>
</div>
</>
)
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/api/send/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NextResponse } from 'next/server'
import { Resend } from 'resend'
import { ContactEmailTemplate } from '@/components/contact-email-template'
import { ContactEmailTemplate } from '@/components/contact/email-template'
import { type ContactEmailTemplateProps } from '@/types'

export const runtime = 'edge'
Expand Down
4 changes: 4 additions & 0 deletions src/app/globals.css → src/app/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@
@apply bg-background text-foreground;
}
}

.not-found ~ .footer {
display: none;
}
12 changes: 7 additions & 5 deletions src/components/career.tsx → src/components/career/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { CareerItem } from './career-item'
import { CareerItem } from './item'
import { useTranslations } from 'next-intl'
import { FileTextIcon } from 'lucide-react'
import { data } from '@/constants'
import { CareerProps } from '@/types'

export function Career() {
const { career } = data
const t = useTranslations('career')
const companies: CareerProps[] = t.raw('companies')

return (
<>
<h2 className='dark:text-neutral-100 text-neutral-800 flex gap-x-4 items-center text-3xl font-bold text-balance'>
<FileTextIcon className='size-6 animate-pulse stroke-[1.5]' />
Career & Works
{t('title')}
</h2>

<ol className='relative border-s dark:border-neutral-600 border-neutral-400 ml-[11.5px] flex flex-col gap-y-8'>
{career.map((item, index) => (
{companies.map((item, index) => (
<li key={index} className='ms-[30px]'>
<CareerItem {...item} />
</li>
Expand Down
Loading