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
+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;