Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created buy now button #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions components/buybutton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
/**
*
*
* @export
* @class BuyNow
* @augments {React.PureComponent<BuyNowProps>}
*/
export default class BuyNow extends React.PureComponent {
/**
* @typedef {object} BuyNowProps
* @property {function} onClick
*
* @static
* @memberof BuyNow
*/


render() {
return (
<React.Fragment>
<style jsx>{`
button {
background-color: #e33812;
color: white;
padding: 15px 32px;
text-align: center;
display: inline-block;
font-size: 16px;
border-radius: 12px;

}
`}</style>

<button onClick={this.props.onClick}>
{this.props.children}
</button>
</React.Fragment>
);
}
}
10 changes: 9 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,11 +51,18 @@ export default class IndexPage extends React.PureComponent {
<Item id={id} name={name} />
))}
</ul>
<<<<<<< HEAD
</main>

=======
<h2>Buy Now Button</h2>
<buybutton/>
</main>

>>>>>>> 1f4ffb7... buy now button
</React.Fragment>
);
}

/**
* This is for demo purposes.
* Once the component has mounted, we fetch items from our API and sets them to state.
Expand Down