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

Add <CheckoutButton /> Component #27

Open
wants to merge 1 commit 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
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
"contributions": [
"docs"
]
},
{
"login": "roygrv21",
"name": "Gaurav Roy",
"avatar_url": "https://avatars1.githubusercontent.com/u/36206378?v=4",
"profile": "https://github.com/roygrv21",
"contributions": [
"code"
]
}
]
}
27 changes: 27 additions & 0 deletions components/CheckoutButton/CheckoutButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';

const CheckoutButton = () => (
<React.Fragment>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you take ({ children, ...otherProps }) and instead of hard coded text put children and spread otherProps at root component (a)? This way we can bind event listeners, classNames etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, will do this tonight :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update?

<style jsx>{`
a {
background: #3498db;
background-image: linear-gradient(to bottom, #3498db, #2980b9);
border-radius: 28px;
font-family: Arial;
color: #ffffff;
font-size: 20px;
padding: 10px 20px 10px 20px;
border: solid #1f628d 0px;
text-decoration: none;
}
a:hover {
background: #3cb0fd;
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
`}</style>
<a href="#">Payment Link</a>
</React.Fragment>
);

export default CheckoutButton;
1 change: 1 addition & 0 deletions components/CheckoutButton/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './CheckoutButton';
3 changes: 3 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Item from '../components/Item';
import CheckoutButton from '../components/CheckoutButton';

/**
* Home page
Expand Down Expand Up @@ -39,6 +40,8 @@ export default class IndexPage extends React.PureComponent {
<Item key={id} name={name} />
))}
</ul>

<CheckoutButton />
</main>
</React.Fragment>
);
Expand Down