Skip to content

Commit

Permalink
buy now button
Browse files Browse the repository at this point in the history
  • Loading branch information
Pallavi024 committed Jul 2, 2018
1 parent add6ce5 commit 1f4ffb7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
10 changes: 0 additions & 10 deletions components/BuyButton.js

This file was deleted.

34 changes: 34 additions & 0 deletions components/buybutton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import PropTypes from 'prop-types';
/**
*
*
* @export
* @class buybutton
* @augments {React.PureComponent<buybuttonProps>}
*/
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 (
<React.Fragment>
<button>Buy Now</button>
</React.Fragment>
);
}
}
6 changes: 5 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,7 +51,10 @@ export default class IndexPage extends React.PureComponent {
<Item id={id} name={name} />
))}
</ul>
</main>
<h2>Buy Now Button</h2>
<buybutton/>
</main>

</React.Fragment>
);
}
Expand Down

0 comments on commit 1f4ffb7

Please sign in to comment.