-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_app.js
38 lines (35 loc) · 1.02 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
import Layout from "../components/layout/Layout";
import Loader from "../components/loader/Loader";
import "../styles/globals.css";
import NProgress from "nprogress";
import { useState } from "react";
import Head from "next/head";
import { Router } from "next/router";
NProgress.configure({ showSpinner: false });
export default function App({ Component, pageProps }) {
const [loading, setLoading] = useState(false);
Router.events.on("routeChangeStart", () => {
setLoading(true);
NProgress.start();
});
Router.events.on("routeChangeComplete", () => {
setLoading(false);
NProgress.done();
});
return (
<>
<Head>
<title>GDSC NIT-Andhra</title>
<meta
name="description"
content="Come join us in the Adventure of becoming a better Developer, together."
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Layout>
{loading && <Loader />}
<Component {...pageProps} />
</Layout>
</>
);
}