feat: enhance contact form with toast notifications and error handling
This commit is contained in:
@@ -2,6 +2,7 @@ import { Inter } 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';
|
||||
@@ -45,11 +46,37 @@ export default async function RootLayout({children, params}: Props) {
|
||||
<body className={`${inter.className} bg-background text-text-primary`}>
|
||||
<ThemeProvider>
|
||||
<NextIntlClientProvider locale={locale}>
|
||||
|
||||
<Header />
|
||||
<main className="flex flex-col items-center">
|
||||
{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>
|
||||
|
||||
Reference in New Issue
Block a user