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

ButtonGroup #23

Open
dstuecken opened this issue May 20, 2016 · 1 comment
Open

ButtonGroup #23

dstuecken opened this issue May 20, 2016 · 1 comment

Comments

@dstuecken
Copy link
Contributor

I think of a ButtonGroup component that is capable of displaying all the buttons you want with just one single component. Because usually you want to share the same url with the same message at one time. So what you basically can do with a button group would be something like that:

render() {
  const url = "https://github.com/olahol/react-socia", message = "So cool!";
  const buttonsToShow = [{
       button: 'Facebook',
       style: BUTTON_WITH_COUNTER,
       appId: 'my-facebook-app-id'
    }, {
       button: 'Google',
       style: BUTTON_WITHOUT_COUNTER
    }, {
       button: 'Reddit'
    }
  ];

  return (
    <div className="btn-group">
      <ButtonGroup url={url} message={message} buttons={buttonsToShow} />
    </div>
  )
}

url and message are directly passed down to every button props since it is always the same. appId is only passed if available and needed. And there can be a button style that can display a button itself or one with a couter.

What do you guys think of that approach?

@olahol
Copy link
Owner

olahol commented May 24, 2016

This sounds like a great idea, I've also been wanting incorporate styles.

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

No branches or pull requests

2 participants