File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -13,27 +13,30 @@ export default class BuyNow extends React.PureComponent {
13
13
* @static
14
14
* @memberof BuyNow
15
15
*/
16
- clicked ( ) {
17
- console . log ( 'the button is clicked' ) ;
18
- }
19
-
16
+
17
+ clicked ( ) {
18
+ console . log ( 'the button is clicked' ) ; //eslint-disable-line no-console
19
+ }
20
20
21
21
render ( ) {
22
22
return (
23
23
< React . Fragment >
24
24
< style jsx > { `
25
25
button {
26
26
background-color: #e33812;
27
- color: white;
28
- padding: 15px 32px;
29
- text-align: center;
30
- display: inline-block;
31
- font-size: 16px;
32
- border-radius: 12px;
27
+ color: white;
28
+ padding: 15px 32px;
29
+ text-align: center;
30
+ display: inline-block;
31
+ font-size: 16px;
32
+ border-radius: 12px;
33
33
34
34
}
35
35
` } </ style >
36
- < button onClick = { this . clicked } > Buy Now</ button >
36
+
37
+ < button onClick = { this . props . onClick } >
38
+ { this . props . children }
39
+ </ button >
37
40
</ React . Fragment >
38
41
) ;
39
42
}
Original file line number Diff line number Diff line change @@ -50,12 +50,11 @@ export default class IndexPage extends React.PureComponent {
50
50
< Item id = { id } name = { name } />
51
51
) ) }
52
52
</ ul >
53
- </ main >
54
-
53
+ </ main >
54
+
55
55
</ React . Fragment >
56
56
) ;
57
57
}
58
-
59
58
/**
60
59
* This is for demo purposes.
61
60
* Once the component has mounted, we fetch items from our API and sets them to state.
You can’t perform that action at this time.
0 commit comments