Skip to content

Commit 973d794

Browse files
author
Ives van Hoorne
committed
Put Stripe back on window
1 parent 8f213e0 commit 973d794

File tree

2 files changed

+24
-52
lines changed

2 files changed

+24
-52
lines changed

src/app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<!-- End Google Tag Manager -->
3939
<script src="https://cdn.ravenjs.com/3.17.0/raven.min.js" crossorigin="anonymous"></script>
4040
<script async src="//cdn.headwayapp.co/widget.js"></script>
41+
<script async src="https://js.stripe.com/v3/"></script>
4142

4243
<!-- AMD Loader for Monaco -->
4344
<script src="/public/vs/loader.js"></script>

src/app/pages/Patron/index.js

Lines changed: 23 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,56 +17,27 @@ const Content = styled.div`
1717
color: white;
1818
`;
1919

20-
type State = {
21-
stripeLoaded: boolean,
22-
};
23-
24-
export default class Patron extends React.PureComponent<void, State> {
25-
constructor() {
26-
super();
27-
const stripeLoaded = Boolean(window.Stripe);
28-
29-
if (!stripeLoaded) {
30-
const script = document.createElement('script');
31-
script.setAttribute('src', 'https://js.stripe.com/v3/');
32-
script.async = false;
33-
document.head.appendChild(script);
34-
35-
script.onload = () => {
36-
this.setState({ stripeLoaded: true });
37-
};
38-
}
39-
40-
this.state = {
41-
stripeLoaded,
42-
};
43-
}
44-
45-
render() {
46-
document.title = 'Patron - CodeSandbox';
47-
48-
if (!this.state.stripeLoaded) return null;
49-
50-
return (
51-
<MaxWidth>
52-
<Margin vertical={1.5} horizontal={1.5}>
53-
<Navigation title="Become a Patron" />
54-
<Content>
55-
<MaxWidth width={1024}>
56-
<Title>Become a CodeSandbox Patron!</Title>
57-
<SubTitle>
58-
You can support us by paying a monthly amount of your choice.
59-
<br />
60-
The money goes to all expenses of CodeSandbox.
61-
</SubTitle>
62-
63-
<Centered horizontal>
64-
<PricingModal />
65-
</Centered>
66-
</MaxWidth>
67-
</Content>
68-
</Margin>
69-
</MaxWidth>
70-
);
71-
}
20+
export default function Patron() {
21+
document.title = 'Patron - CodeSandbox';
22+
return (
23+
<MaxWidth>
24+
<Margin vertical={1.5} horizontal={1.5}>
25+
<Navigation title="Become a Patron" />
26+
<Content>
27+
<MaxWidth width={1024}>
28+
<Title>Become a CodeSandbox Patron!</Title>
29+
<SubTitle>
30+
You can support us by paying a monthly amount of your choice.
31+
<br />
32+
The money goes to all expenses of CodeSandbox.
33+
</SubTitle>
34+
35+
<Centered horizontal>
36+
<PricingModal />
37+
</Centered>
38+
</MaxWidth>
39+
</Content>
40+
</Margin>
41+
</MaxWidth>
42+
);
7243
}

0 commit comments

Comments
 (0)