mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-02 02:10:27 +00:00
Improve styles initialization
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect } from 'react';
|
|||||||
|
|
||||||
import type { AppProps } from 'next/app';
|
import type { AppProps } from 'next/app';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
|
import Script from 'next/script';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
|
|
||||||
import Nav from '../components/Nav';
|
import Nav from '../components/Nav';
|
||||||
@@ -14,6 +15,8 @@ import Footer from '../components/Footer';
|
|||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
|
|
||||||
|
import { initStyles } from '../utils/styles';
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false });
|
NProgress.configure({ showSpinner: false });
|
||||||
|
|
||||||
const App = ({ Component, pageProps }: AppProps) => {
|
const App = ({ Component, pageProps }: AppProps) => {
|
||||||
@@ -35,6 +38,13 @@ const App = ({ Component, pageProps }: AppProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Script
|
||||||
|
id='styles-init'
|
||||||
|
strategy='afterInteractive'
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: initStyles()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Head>
|
<Head>
|
||||||
<link rel='shortcut icon' href='light-favicon.png' id='light-favicon'></link>
|
<link rel='shortcut icon' href='light-favicon.png' id='light-favicon'></link>
|
||||||
<link rel='shortcut icon' href='dark-favicon.png' id='dark-favicon'></link>
|
<link rel='shortcut icon' href='dark-favicon.png' id='dark-favicon'></link>
|
||||||
|
|||||||
Reference in New Issue
Block a user