Skip to content

Commit 1f4ffb7

Browse files
committed
buy now button
1 parent add6ce5 commit 1f4ffb7

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

components/BuyButton.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

components/buybutton.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
/**
4+
*
5+
*
6+
* @export
7+
* @class buybutton
8+
* @augments {React.PureComponent<buybuttonProps>}
9+
*/
10+
export default class buybutton extends React.PureComponent {
11+
/**
12+
* @typedef {object} buybuttonProps
13+
* @property {array} links
14+
*
15+
* @static
16+
* @memberof buybutton
17+
*/
18+
static propTypes = {
19+
links: PropTypes.arrayOf(
20+
PropTypes.shape({
21+
url: PropTypes.string,
22+
title: PropTypes.string,
23+
})
24+
).isRequired,
25+
};
26+
27+
render() {
28+
return (
29+
<React.Fragment>
30+
<button>Buy Now</button>
31+
</React.Fragment>
32+
);
33+
}
34+
}

pages/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Item from '../components/Item';
33
import NavBar from '../components/NavBar';
44
import links from '../constants/links';
5+
import buybutton from '../components/buybutton';
56

67
/**
78
* Home page
@@ -50,7 +51,10 @@ export default class IndexPage extends React.PureComponent {
5051
<Item id={id} name={name} />
5152
))}
5253
</ul>
53-
</main>
54+
<h2>Buy Now Button</h2>
55+
<buybutton/>
56+
</main>
57+
5458
</React.Fragment>
5559
);
5660
}

0 commit comments

Comments
 (0)