From d52365a204613871f454d3917e4627ae426a6e82 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Tue, 23 Oct 2018 09:55:42 +1100 Subject: [PATCH] /shrug --- package.json | 1 + src/app/components/Ad.jsx | 6 +---- src/app/pages/AboutPage.jsx | 9 +++---- src/app/pages/OutfittingPage.jsx | 9 +++---- src/app/pages/ShipyardPage.jsx | 9 +++---- src/index.ejs | 44 +++++++++++++++++--------------- 6 files changed, 35 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 76412faa..68727cd5 100644 --- a/package.json +++ b/package.json @@ -134,6 +134,7 @@ "pako": "^1.0.6", "prop-types": "^15.6.2", "react": "^15.5.4", + "react-adsense": "0.0.6", "react-dom": "^15.5.4", "react-extras": "^0.7.1", "react-ga": "^2.5.3", diff --git a/src/app/components/Ad.jsx b/src/app/components/Ad.jsx index eb3cee6e..f81d3566 100644 --- a/src/app/components/Ad.jsx +++ b/src/app/components/Ad.jsx @@ -12,11 +12,7 @@ export default class Ad extends Component { } // This code is ran when the component mounts componentDidMount() { - try { - (window.adsbygoogle = window.adsbygoogle || []).push({}); - } catch (err) { - console.error(err); - } + } // an outer div for styling purposes diff --git a/src/app/pages/AboutPage.jsx b/src/app/pages/AboutPage.jsx index 5b29f976..ebc922d1 100644 --- a/src/app/pages/AboutPage.jsx +++ b/src/app/pages/AboutPage.jsx @@ -1,7 +1,7 @@ import React from 'react'; import Page from './Page'; import { CoriolisLogo, GitHub } from '../components/SvgIcons'; -import Ad from '../components/Ad'; +import AdSense from 'react-adsense'; /** * About Page @@ -128,14 +128,11 @@ export default class AboutPage extends Page { height="1" /> - ); diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index 12365d3e..0a659736 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -23,7 +23,7 @@ import { } from '../components/SvgIcons'; import LZString from 'lz-string'; import ShipSummaryTable from '../components/ShipSummaryTable'; -import Ad from '../components/Ad'; +import AdSense from 'react-adsense'; import StandardSlotSection from '../components/StandardSlotSection'; import HardpointSlotSection from '../components/HardpointSlotSection'; import InternalSlotSection from '../components/InternalSlotSection'; @@ -1096,14 +1096,11 @@ export default class OutfittingPage extends Page { opponentEng={opponentEng} opponentWep={opponentWep} /> - ); diff --git a/src/app/pages/ShipyardPage.jsx b/src/app/pages/ShipyardPage.jsx index 0f4f8110..10f0994f 100644 --- a/src/app/pages/ShipyardPage.jsx +++ b/src/app/pages/ShipyardPage.jsx @@ -6,7 +6,7 @@ import Ship from '../shipyard/Ship'; import * as ModuleUtils from '../shipyard/ModuleUtils'; import { SizeMap } from '../shipyard/Constants'; import Link from '../components/Link'; -import Ad from '../components/Ad'; +import AdSense from 'react-adsense'; /** * Counts the hardpoints by class/size @@ -612,14 +612,11 @@ export default class ShipyardPage extends Page { {detailRows} - diff --git a/src/index.ejs b/src/index.ejs index 1831281f..00379734 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -5,12 +5,15 @@ - + - + - + @@ -29,21 +32,21 @@ window.CORIOLIS_DATE = '<%- htmlWebpackPlugin.options.date.toISOString().slice(0, 10) %>'; window.BUGSNAG_VERSION = '<%- htmlWebpackPlugin.options.version + '-' + htmlWebpackPlugin.options.date.toISOString() %>'; - + <% if (htmlWebpackPlugin.options.uaTracking) { %> - - - <% } %> + + <% } %> - - + - + - - - - + + - - -
+ + +
- - + +