Skip to content

checkbox variant - outline #1067

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 3 commits into from
Dec 15, 2020
Merged

Conversation

mackbrowne
Copy link
Contributor

@mackbrowne mackbrowne commented Dec 8, 2020

Description

Alternative style for checkbox that wasn't possible with basic styling and theming alone.

Screenshot 2020-12-08 at 19 11 57

Screenshot 2020-12-08 at 19 11 52

Changelog

Added optional boolean outline prop. The checkbox acts normal when false and by default.

@mackbrowne mackbrowne changed the title add outline prop to checkbox checkbox variant - outline Dec 8, 2020
@mackbrowne mackbrowne force-pushed the feature/outline-checkbox branch from 6158b3f to ad595f2 Compare December 8, 2020 18:13
Copy link
Collaborator

@ethanshar ethanshar left a comment

Choose a reason for hiding this comment

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

Hi @mackbrowne
Great feature. Thanks for the PR.
See my comment, I found two issues.

>
<Animated.Image
style={[
this.styles.selectedIcon,
color && {tintColor: iconColor},
color && {tintColor: outline ? this.getColor() : DEFAULT_ICON_COLOR},
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's an issue here.
You ignore the iconColor prop.
If a checkbox starts disabled and then become enabled in runtime.
The checkmark icon color will stay grey

Also, with when passing the outline flag, iconColor is being ignored.

I suggest moving the logic of the icon color to a separate function (getIconColor) and apply in runtime.
setting it in createStyles will not take effect in runtime..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ethanshar thanks for the quick feedback! I'll add this soon.

I also noticed a bug with 'outline - no color - disabled` seen in the screenshot above which I think is caused by the runtime scenario you explained. I'll do another round of cleaning it up today and get back to you.

Copy link
Contributor Author

@mackbrowne mackbrowne Dec 9, 2020

Choose a reason for hiding this comment

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

@ethanshar this should be fixed now with the new commit!

I also took the liberty of creating DEFAULT_BORDER_WIDTH and DEFAULT_BORDER_RADIUS constants and included them with the rest of the constants for this component. I hope this is ok!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ethanshar what is the process here? Should I resolve this or leave it for you to review then close?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi,
Sorry for the late response.
There's still small issue.
See my comment.

@mackbrowne mackbrowne force-pushed the feature/outline-checkbox branch from 3ddd9c3 to a8b2c88 Compare December 9, 2020 12:52
@mackbrowne mackbrowne force-pushed the feature/outline-checkbox branch from a8b2c88 to b9f4332 Compare December 9, 2020 12:54
@mackbrowne
Copy link
Contributor Author

Updated Screenshots

Simulator Screen Shot - iPhone 11 - 2020-12-09 at 13 55 02
Simulator Screen Shot - iPhone 11 - 2020-12-09 at 13 55 06

@ethanshar ethanshar merged commit 68471e8 into wix:master Dec 15, 2020
@mackbrowne mackbrowne deleted the feature/outline-checkbox branch December 16, 2020 09:10
M-i-k-e-l added a commit that referenced this pull request Dec 20, 2020
* master:
  configure 'max-len'; turn off 'jsx-no-bind' (#1087)
  remove unnecessary view (#1084)
  Counter Icon badge (#1081)
  checkbox variant - outline (#1067)
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