From ae0d5e07b0d55653f8f46b87184729d25da56105 Mon Sep 17 00:00:00 2001 From: Rocky Wu Date: Mon, 9 Sep 2019 22:45:14 +0800 Subject: [PATCH] fix ga --- package.json | 6 +- pages/_app.tsx | 22 ++- pages/_document.tsx | 4 - pages/index.tsx | 10 +- yarn.lock | 437 ++++++++++++++++++++++++++------------------ 5 files changed, 283 insertions(+), 196 deletions(-) diff --git a/package.json b/package.json index 7a760c8..995fc6e 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,11 @@ "author": "Rocky Wu ", "license": "MIT", "devDependencies": { - "@mdx-js/react": "^1.3.1", - "@next/mdx": "^9.0.4", + "@mdx-js/react": "^1.4.5", + "@next/mdx": "^9.0.5", "@ts-mono/base": "rwu823/ts-mono#base/latest", "@ts-mono/dev-react": "rwu823/ts-mono#dev-react", - "next": "^9.0.4", + "next": "^9.0.5", "npm-run-all": "^4.1.5", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/pages/_app.tsx b/pages/_app.tsx index 3bb8d2f..f54b306 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,13 +1,16 @@ import React from 'react' import styled, { css } from 'styled-components' -import NextApp, { Container, AppContext } from 'next/app' +import NextApp, { AppContext } from 'next/app' import GlobalStyles from '@ts-mono/dev-react/components/GlobalStyles' import { mdxRenders } from '@ts-mono/dev-react/components/mdx-renders' import GlobalStateProvider from '@ts-mono/dev-react/components/GlobalStateProvider' +import GA from '@ts-mono/dev-react/share/GA' const { MDXProvider } = require('@mdx-js/react') +const ga = new GA('UA-4476856-23', { debug: true }) + const Main = styled.div` ${(_p: {}) => css` max-width: 800px; @@ -28,18 +31,17 @@ class App extends NextApp { render() { const { Component, pageProps } = this.props + ga.pageView() return ( - + - -
- - - -
-
-
+
+ + + +
+ ) } } diff --git a/pages/_document.tsx b/pages/_document.tsx index 618185b..51c1cf3 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -43,10 +43,6 @@ class MyDocument extends Document { href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" /> -