-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path_app.tsx
47 lines (40 loc) · 1.17 KB
/
_app.tsx
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
import React from 'react';
import App from 'next/app';
import Head from 'next/head';
import Router from 'next/router';
import NProgress from 'nprogress';
import { GlobalStateProvider } from '../utils/state';
import { track } from '../utils/analytics';
Router.events.on('routeChangeStart', () => {
NProgress.start();
});
Router.events.on('routeChangeComplete', () => {
NProgress.done();
track('pageview');
});
Router.events.on('routeChangeError', () => NProgress.done());
export default class CodeSandboxCI extends App {
componentDidMount() {
track('pageview');
}
render() {
const { Component, pageProps } = this.props;
return (
<GlobalStateProvider>
<Head>
<title>
{pageProps.title
? `${pageProps.title} - CodeSandbox CI`
: 'CodeSandbox CI'}
</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
<meta
name="description"
content="CodeSandbox CI is a continuous integration system built for open source library maintainers."
/>
</Head>
<Component {...pageProps} />
</GlobalStateProvider>
);
}
}