Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to CodeFund #871

Merged
merged 2 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
import React from 'react';
import './CodeSponsor.css';

type Props = {
token: string,
theme: 'dark' | 'light',
};
const CODEFUND_LINK =
'https://codefund.io/scripts/1fc4e04d-9622-4844-81f9-7522c7d19ac7/embed.js?theme=codesandbox';
let loaded = false;

export default ({ token, theme }: Props) => {
const pixelHref = `https://codesponsor.io/t/l/${token}/pixel.png`;
const linkHref = `https://codesponsor.io/t/c/${token}/`;
export default class CodeFund extends React.PureComponent {
componentDidMount() {
if (!loaded) {
loaded = true;

return (
<div className={theme === 'dark' ? 'cs__wrapper dark' : 'cs__wrapper'}>
<div className="cs__header">Proudly sponsored by</div>
<a href={linkHref} className="cs__blurb" target="_blank" rel="noopener">
<strong>Rollbar</strong>{' '}
<span>
Real-time error monitoring, alerting, and analytics for software
developers{' '}
<span aria-label="rocket" role="img">
🚀
</span>
</span>
</a>
<img alt="CodeSponsor" className="cs__pixel" src={pixelHref} />
</div>
);
};
const script = document.createElement('script');
script.setAttribute('src', CODEFUND_LINK);
script.async = 'true';
script.setAttribute('id', 'external-js');
document.head.appendChild(script);
}
}

render() {
return (
<div>
<div id="codefund_ad" />
</div>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ import React from 'react';

import CodeSponsor from './CodeSponsor';

export default () => (
<CodeSponsor token="a2bc283fb2c6e5c878cf6141edb03f09" theme="dark" />
);
export default () => <CodeSponsor />;