mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
✨ feat: 添加Footer组件并在RootLayout中引入,增强页面结构
style: 更新globals.css,调整sonner-toast背景颜色 fix: 修改request.ts中的日志级别为debug,优化错误信息输出
This commit is contained in:
@ -4,6 +4,7 @@ import { motion } from 'framer-motion'
|
|||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
import { Navbar } from '@/components/navbar'
|
import { Navbar } from '@/components/navbar'
|
||||||
import { BackgroundProvider } from '@/contexts/background-context'
|
import { BackgroundProvider } from '@/contexts/background-context'
|
||||||
|
import Footer from '@/components/footer'
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
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>
|
<div className='container mx-auto px-4 sm:px-6 lg:px-10 max-w-7xl'>{children}</div>
|
||||||
</BackgroundProvider>
|
</BackgroundProvider>
|
||||||
</motion.main>
|
</motion.main>
|
||||||
|
<Footer />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -124,3 +124,7 @@
|
|||||||
html, body {
|
html, body {
|
||||||
transition: background-color 0.3s, color 0.3s !important;
|
transition: background-color 0.3s, color 0.3s !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sonner-toast {
|
||||||
|
background-color: aqua;
|
||||||
|
}
|
@ -32,7 +32,7 @@ export default async function RootLayout({
|
|||||||
<body
|
<body
|
||||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||||
>
|
>
|
||||||
<Toaster richColors/>
|
<Toaster richColors position="top-center" offset={80} />
|
||||||
<DeviceProvider>
|
<DeviceProvider>
|
||||||
<NextIntlClientProvider>{children}</NextIntlClientProvider>
|
<NextIntlClientProvider>{children}</NextIntlClientProvider>
|
||||||
</DeviceProvider>
|
</DeviceProvider>
|
||||||
|
10
web/src/components/footer.tsx
Normal file
10
web/src/components/footer.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
@ -10,7 +10,7 @@ export default getRequestConfig(async () => {
|
|||||||
try {
|
try {
|
||||||
return (await import(`@/locales/${locale}.json`)).default;
|
return (await import(`@/locales/${locale}.json`)).default;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(`Failed to load locale ${locale}:`, err);
|
console.debug(`Failed to load locale ${locale}:`);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user