File tree Expand file tree Collapse file tree 2 files changed +30
-19
lines changed Expand file tree Collapse file tree 2 files changed +30
-19
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import PropTypes from 'prop-types' ;
3
2
/**
4
3
*
5
4
*
6
5
* @export
7
- * @class buybutton
8
- * @augments {React.PureComponent<buybuttonProps > }
6
+ * @class BuyNow
7
+ * @augments {React.PureComponent<BuyNowProps > }
9
8
*/
10
- export default class buybutton extends React . PureComponent {
9
+ export default class BuyNow extends React . PureComponent {
11
10
/**
12
- * @typedef {object } buybuttonProps
13
- * @property {array } links
14
- *
15
- * @static
16
- * @memberof buybutton
11
+ * @typedef {object } BuyNowProps
12
+ * @property {function } onClick
13
+ *
14
+ * @static
15
+ * @memberof BuyNow
17
16
*/
18
- static propTypes = {
19
- links : PropTypes . arrayOf (
20
- PropTypes . shape ( {
21
- url : PropTypes . string ,
22
- title : PropTypes . string ,
23
- } )
24
- ) . isRequired ,
25
- } ;
17
+
26
18
27
19
render ( ) {
28
20
return (
29
21
< React . Fragment >
30
- < button > Buy Now</ button >
22
+ < style jsx > { `
23
+ button {
24
+ background-color: #e33812;
25
+ color: white;
26
+ padding: 15px 32px;
27
+ text-align: center;
28
+ display: inline-block;
29
+ font-size: 16px;
30
+ border-radius: 12px;
31
+
32
+ }
33
+ ` } </ style >
34
+
35
+ < button onClick = { this . props . onClick } >
36
+ { this . props . children }
37
+ </ button >
31
38
</ React . Fragment >
32
39
) ;
33
40
}
Original file line number Diff line number Diff line change @@ -51,14 +51,18 @@ export default class IndexPage extends React.PureComponent {
51
51
< Item id = { id } name = { name } />
52
52
) ) }
53
53
</ ul >
54
+ < << << << HEAD
55
+ </main >
56
+
57
+ =======
54
58
< h2 > Buy Now Button</ h2 >
55
59
< buybutton />
56
60
</ main >
57
61
62
+ >>> >>> > 1 f4ffb7 ... buy now button
58
63
</ React . Fragment >
59
64
);
60
65
}
61
-
62
66
/**
63
67
* This is for demo purposes.
64
68
* 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