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

Migrate <Button> #14

Merged
merged 9 commits into from
Mar 31, 2017
Merged

Migrate <Button> #14

merged 9 commits into from
Mar 31, 2017

Conversation

zhusee2
Copy link
Contributor

@zhusee2 zhusee2 commented Mar 30, 2017

Purpose

Bring back <Button> from ic-framework-react.
Note this does not contain the icon-only variant, as I plan to split it to an independent component.

Implement

  1. Add <Button> which supports color and solid modifiers
  2. rowComp() is refactored to set default props of <RowComp>
  3. <Tag> now inherits color from parent nodes.

Demo

2017-03-30 6 04 56

@zhusee2 zhusee2 requested review from paizanmay and cjies March 30, 2017 10:16
src/Button.js Outdated
const BLACK = 'black';
export const BUTTON_COLOR = { BLUE, RED, WHITE, BLACK };

function Button(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Direct extract props from param?

function Button({ color, solid, className, children, ...buttonProps }) {
    // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


Button.propTypes = {
color: PropTypes.oneOf(Object.values(BUTTON_COLOR)),
solid: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

trailing comma?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's now recommended in Airbnb style guide, because it can make git diffs cleaner
https://github.com/airbnb/javascript#commas--dangling


Button.defaultProps = {
color: BLUE,
solid: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

trailing comma?

@zhusee2 zhusee2 requested a review from cjies March 31, 2017 03:17
Copy link
Contributor

@cjies cjies left a comment

Choose a reason for hiding this comment

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

Go Go Power Ranger

@zhusee2 zhusee2 merged commit e1a85ce into develop Mar 31, 2017
@zhusee2 zhusee2 deleted the feature/zhusee_migrate_button branch March 31, 2017 05:57
@zhusee2 zhusee2 mentioned this pull request Apr 17, 2017
@zhusee2 zhusee2 mentioned this pull request May 24, 2017
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants