Files
portfolio-app/frontend/src/app/(i18n)/[locale]/layout.tsx
João Loureiro fe8bbf05f6 feat: Enhance layout and styling with new fonts and components
- Integrated Space Grotesk font alongside Inter in layout.
- Added FloatingSocials component for social media links.
- Updated Footer with a new background color.
- Modified Header to improve spacing and added LanguageSwitcher.
- Refactored LanguageSwitcher to use a dropdown for language selection.
- Updated ProjectCard to include images and improved layout.
- Revamped About section to include categorized skills with animations.
- Enhanced Contact section with animations and improved form styling.
- Updated Hero section with type animation for dynamic text display.
- Refactored Projects section to include animations for project cards.
- Removed Skills section as it was integrated into the About section.
- Updated global styles for light and dark themes, including new animations.
- Updated translations for new skills and hero section text.
2025-06-10 00:27:48 -03:00

95 lines
2.9 KiB
TypeScript

import { Inter, Space_Grotesk } from "next/font/google";
import Header from "@/app/components/Header"; // Usando o Header que forneci
import Footer from "@/app/components/Footer";
import "@/app/globals.css"; // Importando o CSS global
import { Toaster } from 'react-hot-toast';
// Importações importantes do next-intl
import {hasLocale, Locale, NextIntlClientProvider} from 'next-intl';
import { ThemeProvider } from "@/configuration/ThemeContext";
import {getTranslations, setRequestLocale} from 'next-intl/server';
import { ReactNode } from "react";
import { routing } from "@/i18n/routing";
import { notFound } from "next/navigation";
import FloatingSocials from "@/app/components/FloatingSocials";
const inter = Inter({
subsets: ["latin"],
variable: '--font-inter',
});
const space_grotesk = Space_Grotesk({
subsets: ["latin"],
weight: ['300', '400', '500', '700'],
variable: '--font-space-grotesk',
});
type Props = {
children: ReactNode;
params: Promise<{locale: Locale}>;
};
export function generateStaticParams() {
return routing.locales.map((locale) => ({locale}));
}
export async function generateMetadata(props: Omit<Props, 'children'>) {
const {locale} = await props.params;
const t = await getTranslations({locale, namespace: 'metadata'});
return {
title: t('home_title'),
description: t('home_description')
};
}
export default async function RootLayout({children, params}: Props) {
const {locale} = await params;
if (!hasLocale(routing.locales, locale)) {
notFound();
}
setRequestLocale(locale);
return (
<html lang={locale} className={`${inter.variable} ${space_grotesk.variable} scroll-smooth`}>
<body className={`${inter.className} bg-background text-text-primary`}>
<ThemeProvider>
<NextIntlClientProvider locale={locale}>
<FloatingSocials />
<Header />
<main className="flex flex-col">
{children}
</main>
<Footer />
<Toaster
position="bottom-right"
toastOptions={{
// General styles for all toasts
style: {
background: 'var(--color-card)', //
color: 'var(--color-text-primary)', //
border: '1px solid var(--color-border)', //
},
// Specific styles for success toasts
success: {
iconTheme: {
primary: 'var(--color-primary)', //
secondary: 'var(--color-card)', //
},
},
// Specific styles for error toasts
error: {
iconTheme: {
primary: '#ef4444', // A standard red color for errors
secondary: 'var(--color-card)', //
},
},
}}
/>
</NextIntlClientProvider>
</ThemeProvider>
</body>
</html>
);
}