-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_app.js
55 lines (53 loc) · 1.73 KB
/
_app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import "../styles/globals.css";
import "@material-tailwind/react/tailwind.css";
import "tailwindcss/tailwind.css";
import Head from "next/head";
import { Provider } from "next-auth/client";
import NProgress from "next-nprogress-emotion";
import { useEffect } from "react";
function MyApp({ Component, pageProps }) {
useEffect(() => {
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("/sw.js").then(
function (registration) {
console.log(
"Service Worker registration successful with scope: ",
registration.scope
);
},
function (err) {
console.log("Service Worker registration failed: ", err);
}
);
});
}
}, []);
return (
<Provider session={pageProps.session}>
<Head>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
/>
<meta
name="description"
content="Google docs made with the help of next.js and tailwind css"
/>
<meta name="theme-color" content="#000" />
<link rel="manifest" href="/manifest.json" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png"></link>
</Head>
<Component {...pageProps} />
<NProgress color="#4186F5" />
</Provider>
);
}
export default MyApp;