Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: fix carbon ads
  • Loading branch information
TheSharpieOne committed Jul 25, 2020
1 parent cefd92b commit aa63f99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions docs/lib/UI/Carbon.js
@@ -0,0 +1,20 @@
import React, { Component } from 'react';

class Carbon extends Component {
componentDidMount() {
const carbon_wrapper = document.querySelector('.carbon-adds-wrapper');
const script = document.createElement("script");
script.src = '//cdn.carbonads.com/carbon.js?serve=CE7IPK3E&placement=reactstrapgithubio';
script.async = true;
script.id = "_carbonads_js"
carbon_wrapper.appendChild(script);
}

render() {
return (
<div className="carbon-adds-wrapper" />
);
}
}

export default Carbon;
4 changes: 3 additions & 1 deletion docs/lib/UI/Content.js
Expand Up @@ -3,6 +3,8 @@ import { Link } from 'react-router';
import PropTypes from 'prop-types';
import { Container, Row, Col, Nav, NavItem, NavLink } from 'reactstrap';

import Carbon from './Carbon';

const propTypes = {
children: PropTypes.node,
items: PropTypes.array,
Expand All @@ -15,7 +17,7 @@ function Content({ items, children, title }) {
<Row>
<Col className="docSearch-navigation" tag="main" md={{ size: 3, order: 2 }}>
<div className="docs-sidebar mb-3">
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7IPK3E&placement=reactstrapgithubio" id="_carbonads_js"></script>
<Carbon/>
<h1 className="h5">{title}</h1>
<Nav className="flex-column">
{items.sort((a, b) => a.name.localeCompare(b.name)).map(item => (
Expand Down

0 comments on commit aa63f99

Please sign in to comment.