Skip to content

Commit

Permalink
feat(nprogress): add progress bar when change page
Browse files Browse the repository at this point in the history
  • Loading branch information
chornos13 committed Feb 28, 2021
1 parent 3c04e4c commit 0de1e82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ import getSiteLayout from 'layouts/core/DefaultLayout'
import Head from 'next/head'
import 'styles/vars.scss'
import 'styles/global.scss'
import NProgress from 'nprogress' // nprogress module
import 'nprogress/nprogress.css' // styles of nprogress//Binding events.

const title = 'Nexys'
const description = 'Nexys Boilerplate By Chornos13'
const metaURL = 'https://github.com/chornos13'
const metaImage = '/static/logo.png'
const webIconURL = '/static/favicon.ico'

Router.events.on('routeChangeStart', () => NProgress.start())
Router.events.on('routeChangeComplete', () => NProgress.done())
Router.events.on('routeChangeError', () => NProgress.done())

class MyApp extends App<any, any, { firstMount: boolean }> {
private cacheURL

Expand Down

0 comments on commit 0de1e82

Please sign in to comment.