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

Added support for .buttons class #95

Merged
merged 7 commits into from
Oct 13, 2018
Merged

Added support for .buttons class #95

merged 7 commits into from
Oct 13, 2018

Conversation

kennethnym
Copy link
Collaborator

@kennethnym kennethnym commented Oct 12, 2018

Doc for .button class: https://bulma.io/documentation/elements/button/#list-of-buttons.

New component: <Button.Group />
Props:

{
  hasAddons: PropTypes.bool,
  position: PropTypes.oneOf([undefined, '', 'centered', 'right']),
  renderAs: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.func 
  ])
}

New/modified props for <Button />:

  • renderAs now supports <span>
  • { isSelected: PropTypes.bool }

Closes issue: #93

@coveralls
Copy link

coveralls commented Oct 12, 2018

Coverage Status

Coverage increased (+0.007%) to 99.118% when pulling ff54c95 on MrCreeper1008:master into 71e6902 on couds:master.

@couds
Copy link
Owner

couds commented Oct 12, 2018

Hi @MrCreeper1008 Thanks for the PR. What do you think about changing a little the approach. to use this component like this

<Button.Group>
  <Button>Button 1</Button>
  <Button>Button 2</Button>
  <Button>Button 3</Button>
</Button.Group>

wdyt?

Copy link
Owner

@couds couds left a comment

Choose a reason for hiding this comment

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

Can you check this changes? Thanks for the PR btw

src/components/buttons/buttons.js Outdated Show resolved Hide resolved
src/components/buttons/buttons.js Outdated Show resolved Hide resolved
@kennethnym
Copy link
Collaborator Author

@couds I'll combine all the modifications into the next commit. Thanks for the suggestions! :)

Copy link
Owner

@couds couds left a comment

Choose a reason for hiding this comment

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

One more change and will be done!

src/components/button/components/button-group.js Outdated Show resolved Hide resolved
@kennethnym
Copy link
Collaborator Author

Excuse the stupid mistake...I forgot to use the renderAs prop...

@kennethnym
Copy link
Collaborator Author

Updated original PR description.

@kennethnym
Copy link
Collaborator Author

Hi, I'm about to sleep. Could you help me fix it? Thank you :D

@couds
Copy link
Owner

couds commented Oct 12, 2018

Sure will do

@couds couds self-assigned this Oct 12, 2018
@kennethnym
Copy link
Collaborator Author

@couds limiting the position prop to only centered and right seems to cause issue with storybook. What should be the default value of position in select('position')? Undefined cannot be the default value.

@kennethnym
Copy link
Collaborator Author

In storybook I mean

@kennethnym
Copy link
Collaborator Author

Thanks for the commit btw

@kennethnym
Copy link
Collaborator Author

@couds the position prop should also allow '' to be valid, because the default value in storybook select('position') cannot be undefined, but can be an empty string. Thoughts?

@couds
Copy link
Owner

couds commented Oct 13, 2018

we can let the storybook as an empty string for the default value but use undefined as a default prop.

@couds couds merged commit 6631be2 into couds:master Oct 13, 2018
@kennethnym
Copy link
Collaborator Author

Thanks @couds!

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.

3 participants