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": {
"version": "1.0.0",
"bundled": true
"bundled": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -3029,15 +3031,18 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -3140,7 +3145,8 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true
"bundled": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -3150,6 +3156,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -3162,17 +3169,20 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true
"bundled": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -3189,6 +3199,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -3261,7 +3272,8 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -3271,6 +3283,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -3376,6 +3389,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^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: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>
<body>
<div id = "root"></div>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script src="/app.bundle.js"></script>
</body>
</html>
+2
View File
@@ -5,6 +5,7 @@ import Loadable from 'react-loadable';
//other stuff
import Footer from './panels/footer.jsx';
import GA from './utilities/google_analytics.jsx';
import GAdverts from './utilities/google_adverts.jsx';
//lazy route loading (with error handling)
const LazyRoute = (props) => {
@@ -54,6 +55,7 @@ export default class App extends React.Component {
render() {
return (
<div className = 'central'>
<GAdverts />
<a className='banner' href='/'><img src={'/img/flag_scaled.png'} /></a>
<BrowserRouter>
{ GA.init() && <GA.RouteTracker /> }
+1 -1
View File
@@ -39,7 +39,7 @@ class Home extends React.Component {
if (this.state.tagline === 'rainbow') {
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 (
+2 -2
View File
@@ -6,9 +6,9 @@ class Markdown extends React.Component {
constructor(props) {
super(props);
if (this.props.source) {
if (props.source !== undefined) {
this.state = {
data: this.props.source
data: props.source
};
} else {
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;