first commit
This commit is contained in:
26
pages/_app.tsx
Normal file
26
pages/_app.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user