Skip to content

Commit b6904d1

Browse files
authored
Carbon ads (codesandbox#325)
1 parent 43cb1f1 commit b6904d1

File tree

1 file changed

+38
-5
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/Advertisement

1 file changed

+38
-5
lines changed
Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,56 @@
11
import React from 'react';
2+
import styled from 'styled-components';
3+
4+
const Container = styled.div`
5+
padding: 1rem;
6+
border-top: 1px solid rgba(0, 0, 0, 0.3);
7+
8+
.carbon-text {
9+
text-decoration: none !important;
10+
color: rgba(255, 255, 255, 0.9) !important;
11+
}
12+
13+
.carbon-wrap {
14+
font-size: 0.875rem;
15+
16+
img {
17+
display: block;
18+
margin-bottom: 0.5rem;
19+
}
20+
}
21+
22+
.carbon-poweredby {
23+
display: block;
24+
margin-top: 0.5rem;
25+
26+
font-size: 0.75rem;
27+
text-decoration: none !important;
28+
color: rgba(255, 255, 255, 0.6) !important;
29+
}
30+
`;
231

332
export default class Advertisement extends React.PureComponent {
433
componentDidMount() {
534
requestAnimationFrame(() => {
635
const script = document.createElement('script');
736
script.setAttribute(
837
'src',
9-
'https://app.codesponsor.io/scripts/o81cdkzTVQe3UbTW0J2EQw?theme=dark&height=150&image=hide'
38+
'//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=codesandboxio'
1039
);
11-
script.async = true;
40+
script.async = 'true';
1241
document.head.appendChild(script);
1342
});
1443
}
1544

1645
render() {
1746
return (
18-
<div style={{ paddingTop: 3, borderTop: '1px solid rgba(0, 0, 0, 0.3)' }}>
19-
<div id="code-sponsor-widget" />
20-
</div>
47+
<Container>
48+
<script
49+
id="_carbonads_js"
50+
src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=codesandboxio"
51+
async="true"
52+
/>
53+
</Container>
2154
);
2255
}
2356
}

0 commit comments

Comments
 (0)