From 1f4ffb7c84e014e398ffb82b19265c1ae5479338 Mon Sep 17 00:00:00 2001 From: Pallavi024 Date: Mon, 2 Jul 2018 23:15:35 +0530 Subject: [PATCH] buy now button --- components/BuyButton.js | 10 ---------- components/buybutton.js | 34 ++++++++++++++++++++++++++++++++++ pages/index.js | 6 +++++- 3 files changed, 39 insertions(+), 11 deletions(-) delete mode 100644 components/BuyButton.js create mode 100644 components/buybutton.js diff --git a/components/BuyButton.js b/components/BuyButton.js deleted file mode 100644 index 7fb6e90..0000000 --- a/components/BuyButton.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; - -var BuyButton = React.createClass({ - - render : function(){ - return ( - - ); - } -}); diff --git a/components/buybutton.js b/components/buybutton.js new file mode 100644 index 0000000..6ccda8f --- /dev/null +++ b/components/buybutton.js @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +/** + * + * + * @export + * @class buybutton + * @augments {React.PureComponent} + */ +export default class buybutton extends React.PureComponent { + /** + * @typedef {object} buybuttonProps + * @property {array} links + * + * @static + * @memberof buybutton + */ + static propTypes = { + links: PropTypes.arrayOf( + PropTypes.shape({ + url: PropTypes.string, + title: PropTypes.string, + }) + ).isRequired, + }; + + render() { + return ( + + + + ); + } +} \ No newline at end of file diff --git a/pages/index.js b/pages/index.js index e735dc9..b282c87 100644 --- a/pages/index.js +++ b/pages/index.js @@ -2,6 +2,7 @@ import React from 'react'; import Item from '../components/Item'; import NavBar from '../components/NavBar'; import links from '../constants/links'; +import buybutton from '../components/buybutton'; /** * Home page @@ -50,7 +51,10 @@ export default class IndexPage extends React.PureComponent { ))} - +

Buy Now Button

+ + + ); }