Fixed markdown issue; Google ads not working

This commit is contained in:
2019-07-01 06:51:03 +10:00
parent 15319b8944
commit 60944af702
6 changed files with 54 additions and 18 deletions
+21 -7
View File
@@ -3012,11 +3012,13 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true "bundled": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -3029,15 +3031,18 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@@ -3140,7 +3145,8 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true "bundled": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@@ -3150,6 +3156,7 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@@ -3162,17 +3169,20 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true "bundled": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@@ -3189,6 +3199,7 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@@ -3261,7 +3272,8 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@@ -3271,6 +3283,7 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@@ -3376,6 +3389,7 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
+1 -8
View File
@@ -20,17 +20,10 @@
<meta property="og:title" content="Kingdom Battles!" /> <meta property="og:title" content="Kingdom Battles!" />
<meta property="og:description" content="Build Your Kingdom!" /> <meta property="og:description" content="Build Your Kingdom!" />
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-3272796169678302",
enable_page_level_ads: true
});
</script>
</head> </head>
<body> <body>
<div id = "root"></div> <div id = "root"></div>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script src="/app.bundle.js"></script> <script src="/app.bundle.js"></script>
</body> </body>
</html> </html>
+2
View File
@@ -5,6 +5,7 @@ import Loadable from 'react-loadable';
//other stuff //other stuff
import Footer from './panels/footer.jsx'; import Footer from './panels/footer.jsx';
import GA from './utilities/google_analytics.jsx'; import GA from './utilities/google_analytics.jsx';
import GAdverts from './utilities/google_adverts.jsx';
//lazy route loading (with error handling) //lazy route loading (with error handling)
const LazyRoute = (props) => { const LazyRoute = (props) => {
@@ -54,6 +55,7 @@ export default class App extends React.Component {
render() { render() {
return ( return (
<div className = 'central'> <div className = 'central'>
<GAdverts />
<a className='banner' href='/'><img src={'/img/flag_scaled.png'} /></a> <a className='banner' href='/'><img src={'/img/flag_scaled.png'} /></a>
<BrowserRouter> <BrowserRouter>
{ GA.init() && <GA.RouteTracker /> } { GA.init() && <GA.RouteTracker /> }
+1 -1
View File
@@ -39,7 +39,7 @@ class Home extends React.Component {
if (this.state.tagline === 'rainbow') { if (this.state.tagline === 'rainbow') {
return (<em><p className='centered rainbowText'>I hope this CSS rainbow effect works in all browsers!</p></em>); return (<em><p className='centered rainbowText'>I hope this CSS rainbow effect works in all browsers!</p></em>);
} }
return (<p className='centered'><em><Markdown source={this.state.tagline} escapeHtml={true} /></em></p>); return (<div className='centered'><em><Markdown source={this.state.tagline} escapeHtml={true} /></em></div>);
} }
return ( return (
+2 -2
View File
@@ -6,9 +6,9 @@ class Markdown extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
if (this.props.source) { if (props.source !== undefined) {
this.state = { this.state = {
data: this.props.source data: props.source
}; };
} else { } else {
this.state = { this.state = {
@@ -0,0 +1,27 @@
import React from 'react';
class GoogleAdverts extends React.Component {
comonentDidMount() {
(adsbygoogle = window.adsbygoogle || []).push({});
}
shouldComponentUpdate() {
return false;
}
render() {
return (
<div className='ad'>
<ins className='adsbygoogle'
style={{display: 'block'}}
data-ad-client='ca-pub-3272796169678302'
data-ad-slot='5669312895'
data-ad-format='auto'
data-full-width-responsive='true'
/>
</div>
);
}
};
export default GoogleAdverts;