1
+ 'use client' ;
1
2
import "../styles/global.css" ;
2
3
import "../styles/reset.css" ;
3
4
import { GoogleAnalytics } from "@next/third-parties/google" ;
4
5
import { ThemeProvider } from "@/context/ThemeContext" ;
5
- import { Metadata } from "next" ;
6
6
import { DARK_COLORS , LIGHT_COLORS } from "theme" ;
7
7
import Script from "next/script" ;
8
+ import Header from "@/components/Header" ;
9
+ import Footer from "@/components/Footer" ;
10
+ import Splash from "@/components/Splash" ;
11
+ import React from "react" ;
12
+
8
13
9
- export const metadata : Metadata = {
10
- title : "Shikhar Gupta | Software Developer | Cloud Engineer | ML Engineer" ,
11
- description :
12
- "Shikhar Gupta is a Computer Science Graduate Student at Arizona State University, who loves learning new things." ,
13
- openGraph : {
14
- type : "website" ,
15
- locale : "en_US" ,
16
- url : "https://shikhar97.github.io/" ,
17
- title : "Shikhar Gupta | Software Developer | Cloud Engineer | ML Engineer" ,
18
- images : [ "https://ogcdn.net/e4b8c678-7bd5-445d-ba03-bfaad510c686/v3/shikhar97.github.io/Shikhar%20Gupta%20%7C%20Computer%20Science%20Graduate%20Student%20%7C%20Software%20Developer%20%7C%20Cloud%20Engineer%20%7C%20ML%20Engineer/https%3A%2F%2Fopengraph.b-cdn.net%2Fproduction%2Fdocuments%2F4c58f7e1-8524-4c7b-a5c3-305cdb16dc61.jpg%3Ftoken%3D2dK5g8ViJZYACO--guzL6sOi3xKQpg77X0m6yX6NzSo%26height%3D513%26width%3D1200%26expires%3D33244548259/og.png" ] ,
19
- } ,
20
- } ;
21
14
22
15
function RootLayout ( { children} : { children : React . ReactNode } ) {
23
- const theme = "light" ;
24
- const themeColors = theme === "light" ? LIGHT_COLORS : DARK_COLORS ;
16
+ const theme = localStorage . getItem ( "color-theme" ) ?? "dark" ;
17
+ const themeColors = theme === "light" ? LIGHT_COLORS : DARK_COLORS ;
18
+ const showSplash = localStorage . getItem ( "show-splash" ) !== "false" ;
19
+ React . useEffect ( ( ) => {
20
+ localStorage . setItem ( "show-splash" , "false" ) ;
21
+ } )
25
22
26
23
return (
27
24
< html
@@ -36,10 +33,15 @@ function RootLayout({children}: { children: React.ReactNode }) {
36
33
< head >
37
34
< link href = "https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css" rel = "stylesheet" />
38
35
< Script src = "https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js" > </ Script >
39
- < title > </ title >
36
+ < title > Shikhar Gupta | Software Developer | Cloud Engineer | ML Engineer </ title >
40
37
</ head >
41
38
< body suppressHydrationWarning = { true } >
42
- < ThemeProvider initialTheme = { theme } > { children } </ ThemeProvider >
39
+ < ThemeProvider initialTheme = { theme } >
40
+ < Header initialTheme = { theme } />
41
+ { children }
42
+ < Footer />
43
+ </ ThemeProvider >
44
+ { showSplash && < Splash /> }
43
45
</ body >
44
46
</ html >
45
47
) ;
0 commit comments