@@ -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