Files
darkwave/app/layout.tsx
AderKonstantin 5f4b2cf1d5 feat: Implement theme switcher in header
This commit introduces a theme switcher component in the header, allowing users to toggle between light and dark modes. The changes include:

- Added a new `ThemeSwitcher` component in `components/header/theme-switcher.tsx` that handles the theme switching logic and UI.
- Integrated the `ThemeSwitcher` component into the `HeaderToolbar` component.
- Updated the global CSS file (`app/globals.css`) to include styles for the light mode.
- Initialized the theme based on user's previous preference or system preference.
- Saved the user's theme preference in the browser's local storage for persistence.

These changes provide a better user experience by allowing users to switch between light and dark modes, which can improve readability and accessibility, especially in different lighting conditions.
2025-03-26 20:58:40 +03:00

44 lines
1.2 KiB
TypeScript

import type { Metadata } from "next";
import "./globals.css";
import MainHeader from "@/components/header/main";
import MainFooter from "@/components/footer/main";
export const metadata: Metadata = {
title: 'AderKI Blog',
description: 'Welcome to AderKI Blog. There will be posts about science',
keywords: ['AderKI', 'hoodies', 'comics', 'books', 'store', 'blog'],
authors: [{ name: 'AderKI' }],
openGraph: {
title: 'AderKI Blog',
description: 'Welcome to AderKI Blog. There will be posts about science',
url: 'https://blog.aderk.tech/',
images: [
{
url: '/images/logo.png', // Path to your Open Graph image
width: 800,
height: 600,
alt: 'AderKI Blog Logo',
},
],
siteName: 'AderKI Blog',
},
icons: {
icon: '/images/favicon.ico', // Path to your favicon
},
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html className="dark" lang="en">
<body className={`bg-black text-white light:bg-white light:text-black font-sans`}>
<div className="text-xl 2xl:mx-64 xl:mx-32 md:mx-6">
<MainHeader />
{children}
<MainFooter />
</div>
</body>
</html>
);
}