Files
Portfolio/pages/_app.tsx
2025-05-13 12:12:47 +02:00

27 lines
607 B
TypeScript

import { useEffect } from 'react';
import type { AppProps } from 'next/app';
import Layout from '@/components/Layout';
import Head from '@/components/Head';
import '@/styles/globals.css';
import '@/styles/themes.css';
function MyApp({ Component, pageProps }: AppProps) {
useEffect(() => {
const theme = localStorage.getItem('theme');
if (theme) {
document.documentElement.setAttribute('data-theme', theme);
}
}, []);
return (
<Layout>
<Head title={`Ahmed Galadima | ${pageProps.title}`} />
<Component {...pageProps} />
</Layout>
);
}
export default MyApp;