Skip to content

Feature/menu checkbox and radio #101

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

Merged
merged 6 commits into from
Feb 29, 2020
Merged

Conversation

arturbien
Copy link
Member

  • 'menu' variant of Checkbox
  • 'menu' variant of Radio

closes #92

@arturbien arturbien requested a review from luizbaldi February 21, 2020 23:47
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 21, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8eb8238:

Sandbox Source
billowing-dust-6nnzb Configuration

const CheckboxComponent =
variant === 'flat' ? StyledFlatCheckbox : StyledCheckbox;

const CheckboxComponent = {
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about declaring this CheckboxComponent outside of render? Since the components are static I don't see a need to declare them on every render, what do you think?

Just to be clear, my idea is to declare the checkbox components outside of render and only instantiate the component that'll be used inside of render, like:

// outside of render
const CheckboxComponents = {
  flat: StyledFlatCheckbox,
  default: StyledCheckbox,
  menu: StyledMenuCheckbox
}

// inside of render
const CheckboxVariant = CheckboxComponents[variant]

Does that make sense for you?

const CheckboxComponent =
variant === 'flat' ? StyledFlatCheckbox : StyledCheckbox;

const CheckboxComponent = {
Copy link
Member

Choose a reason for hiding this comment

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

Same thing for declaring this outside of render goes here.

@arturbien arturbien merged commit 1b636b5 into develop Feb 29, 2020
@arturbien arturbien deleted the feature/menu-checkbox-and-radio branch February 29, 2020 16:07
@arturbien
Copy link
Member Author

🎉 This PR is included in version 3.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@arturbien
Copy link
Member Author

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants