11import React from 'react' ;
22import { render } from 'react-dom' ;
33import CoinbaseCommerceButton from '../../src' ;
4- import styled , { injectGlobal } from 'styled-components' ;
4+ import styled , { createGlobalStyle } from 'styled-components' ;
55
66class App extends React . Component {
77 constructor ( props ) {
@@ -25,44 +25,47 @@ class App extends React.Component{
2525
2626 render ( ) {
2727 return (
28- < div >
29- < span > Enter a checkout ID: </ span >
30- < input type = 'text' onChange = { this . updateCheckoutId } /> < br />
31- { this . state . checkoutId . length > 0 ? (
32- < div >
33- < CoinbaseCommerceButton styled = { true } checkoutId = { this . state . checkoutId } />
34- < CoinbaseCommerceButton styled = { true } disabled > Disabled Button</ CoinbaseCommerceButton >
35- < CoinbaseCommerceButton checkoutId = { this . state . checkoutId } > Ugly Button With Crypto</ CoinbaseCommerceButton >
36- < Button checkoutId = { this . state . checkoutId } > Pretty Custom Button</ Button >
37- < DangerButton checkoutId = { 'wrongo' } > This Button is Bad</ DangerButton >
38- < CoinbaseCommerceButton
39- wrapperStyle = { { width : '100%' } }
40- style = { {
41- width : '100%' ,
42- color : 'green' ,
43- borderColor : 'green' ,
44- borderRadius : 4 ,
45- height : 45 ,
46- cursor : 'pointer' ,
47- } }
48- checkoutId = { this . state . checkoutId } >
49- Custom Styles Button
50- </ CoinbaseCommerceButton >
51- </ div >
52- ) : null }
28+ < React . Fragment >
29+ < div >
30+ < span > Enter a checkout ID: </ span >
31+ < input type = 'text' onChange = { this . updateCheckoutId } /> < br />
32+ { this . state . checkoutId . length > 0 ? (
33+ < div >
34+ < CoinbaseCommerceButton styled = { true } checkoutId = { this . state . checkoutId } />
35+ < CoinbaseCommerceButton styled = { true } disabled > Disabled Button</ CoinbaseCommerceButton >
36+ < CoinbaseCommerceButton checkoutId = { this . state . checkoutId } > Ugly Button With Crypto</ CoinbaseCommerceButton >
37+ < Button checkoutId = { this . state . checkoutId } > Pretty Custom Button</ Button >
38+ < DangerButton checkoutId = { 'wrongo' } > This Button is Bad</ DangerButton >
39+ < CoinbaseCommerceButton
40+ wrapperStyle = { { width : '100%' } }
41+ style = { {
42+ width : '100%' ,
43+ color : 'green' ,
44+ borderColor : 'green' ,
45+ borderRadius : 4 ,
46+ height : 45 ,
47+ cursor : 'pointer' ,
48+ } }
49+ checkoutId = { this . state . checkoutId } >
50+ Custom Styles Button
51+ </ CoinbaseCommerceButton >
52+ </ div >
53+ ) : null }
5354
54- < span > Enter a charge ID: </ span >
55- < input type = 'text' onChange = { this . updateChargeId } /> < br />
56- { this . state . chargeId . length > 0 ? (
57- < div >
58- < CoinbaseCommerceButton styled = { true } chargeId = { this . state . chargeId } />
59- < CoinbaseCommerceButton styled = { true } disabled > Disabled Button</ CoinbaseCommerceButton >
60- < CoinbaseCommerceButton chargeId = { this . state . chargeId } > Ugly Button With Crypto</ CoinbaseCommerceButton >
61- < Button chargeId = { this . state . chargeId } > Pretty Custom Button</ Button >
62- < DangerButton chargeId = { 'wrongo' } > This Button is Bad</ DangerButton >
63- </ div >
64- ) : null }
65- </ div >
55+ < span > Enter a charge ID: </ span >
56+ < input type = 'text' onChange = { this . updateChargeId } /> < br />
57+ { this . state . chargeId . length > 0 ? (
58+ < div >
59+ < CoinbaseCommerceButton styled = { true } chargeId = { this . state . chargeId } />
60+ < CoinbaseCommerceButton styled = { true } disabled > Disabled Button</ CoinbaseCommerceButton >
61+ < CoinbaseCommerceButton chargeId = { this . state . chargeId } > Ugly Button With Crypto</ CoinbaseCommerceButton >
62+ < Button chargeId = { this . state . chargeId } > Pretty Custom Button</ Button >
63+ < DangerButton chargeId = { 'wrongo' } > This Button is Bad</ DangerButton >
64+ </ div >
65+ ) : null }
66+ </ div >
67+ < GlobalStyle />
68+ </ React . Fragment >
6669 )
6770 }
6871}
@@ -89,7 +92,7 @@ const Button = styled(CoinbaseCommerceButton)`
8992 }
9093` ;
9194
92- const DangerButton = Button . extend `
95+ const DangerButton = styled ( Button ) `
9396 background: #FF4136;
9497 &:hover{
9598 box-shadow: 7px 7px 0px 0px #00449E;
@@ -100,7 +103,7 @@ const DangerButton = Button.extend`
100103 }
101104` ;
102105
103- injectGlobal `
106+ const GlobalStyle = createGlobalStyle `
104107 body {
105108 background-color: #f4f4f4;
106109 font-family: system-ui, sans;
0 commit comments