feat: 添加Footer组件并在RootLayout中引入,增强页面结构

style: 更新globals.css,调整sonner-toast背景颜色
fix: 修改request.ts中的日志级别为debug,优化错误信息输出
This commit is contained in:
2025-07-28 11:44:50 +08:00
parent 460ed87ad2
commit c962cf572f
5 changed files with 18 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import { motion } from 'framer-motion'
import { usePathname } from 'next/navigation'
import { Navbar } from '@/components/navbar'
import { BackgroundProvider } from '@/contexts/background-context'
import Footer from '@/components/footer'
export default function RootLayout({
children,
@ -31,6 +32,7 @@ export default function RootLayout({
<div className='container mx-auto px-4 sm:px-6 lg:px-10 max-w-7xl'>{children}</div>
</BackgroundProvider>
</motion.main>
<Footer />
</>
)
}

View File

@ -123,4 +123,8 @@
html, body {
transition: background-color 0.3s, color 0.3s !important;
}
.sonner-toast {
background-color: aqua;
}

View File

@ -32,7 +32,7 @@ export default async function RootLayout({
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<Toaster richColors/>
<Toaster richColors position="top-center" offset={80} />
<DeviceProvider>
<NextIntlClientProvider>{children}</NextIntlClientProvider>
</DeviceProvider>

View File

@ -0,0 +1,10 @@
import config from "@/config";
import React from "react";
export default function Footer() {
return (
<footer className="w-full py-6 text-center text-sm text-gray-500 dark:text-gray-400 border-t border-gray-200 dark:border-gray-700 mt-12">
© {new Date().getFullYear()} {config.metadata.name} · Powered by {config.owner.name}
</footer>
);
}

View File

@ -10,7 +10,7 @@ export default getRequestConfig(async () => {
try {
return (await import(`@/locales/${locale}.json`)).default;
} catch (err) {
console.warn(`Failed to load locale ${locale}:`, err);
console.debug(`Failed to load locale ${locale}:`);
return {};
}
})