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

BREAKING: Chips redesign #369

Closed

Conversation

gawrysiak
Copy link
Collaborator

Chip redesign proposal for 2.0.

screen shot 2018-05-13 at 02 50 56

Motivation

Fixes #357.

Test plan

Snapshot tests updated. Run yarn test.

@callstack-bot
Copy link

callstack-bot commented May 13, 2018

Hey @gawrysiak, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@satya164 satya164 force-pushed the material-next branch 2 times, most recently from 5613de2 to c970557 Compare May 13, 2018 17:45
Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you rebase and drop the unrelated commits?

/**
* Displays the chip as pressed.
*/
pressed?: boolean,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of pressed prop, we should automatically apply the styles on onPressIn and remove them in onPressOut (only when onPress prop is provided).

Copy link
Member

Choose a reason for hiding this comment

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

Also, the pressed style has a elevation shadow (similar to button)

image

/**
* Displays chip with outline.
*/
outlined?: boolean,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of outlined prop, can you add a mode prop similar to button? The values can be flat and outlined, and default would be flat.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I was looking into the button. Couldn't figure out the default mode name. Flat is good 👍

]}
>
{icon || selected ? (
/* $FlowFixMe */ <Icon
Copy link
Member

Choose a reason for hiding this comment

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

Icon margin doesn't seem right:

image

should look something like:

image

Should be same as close button padding, which should be reduced a bit:

image

size={20}
/>
) : null}
{avatar
Copy link
Member

Choose a reason for hiding this comment

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

Probably shouldn't allow both icon and avatarto be specified

Copy link
Member

Choose a reason for hiding this comment

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

For selected state with avatar, a check mark should appear as overlay on the avatar

image

@gawrysiak gawrysiak force-pushed the breaking/chips-redesign branch 3 times, most recently from a56adc8 to af160cc Compare May 13, 2018 19:47
@gawrysiak gawrysiak changed the title breaking: Chips redesign wip: breaking: Chips redesign May 13, 2018
@gawrysiak gawrysiak changed the title wip: breaking: Chips redesign WIP breaking: Chips redesign May 13, 2018
@gawrysiak gawrysiak changed the title WIP breaking: Chips redesign BREAKING: Chips redesign May 13, 2018
@gawrysiak
Copy link
Collaborator Author

Updated:

screen shot 2018-05-14 at 00 33 01

@gawrysiak gawrysiak force-pushed the breaking/chips-redesign branch from 5b68f61 to f6d1b56 Compare May 17, 2018 09:24
@satya164 satya164 force-pushed the material-next branch 2 times, most recently from f394776 to 430b3e6 Compare May 25, 2018 00:49
@gawrysiak gawrysiak force-pushed the breaking/chips-redesign branch 2 times, most recently from ef4b054 to 8344078 Compare May 25, 2018 07:07
@satya164 satya164 force-pushed the material-next branch 3 times, most recently from cf0531b to 1d511cc Compare May 26, 2018 00:16
@gawrysiak gawrysiak force-pushed the breaking/chips-redesign branch from 8344078 to 59f52ae Compare May 28, 2018 21:12
@satya164 satya164 force-pushed the material-next branch 14 times, most recently from ef02cd7 to d8182b4 Compare June 3, 2018 15:56
@8BallBomBom
Copy link

Selected with image looks like it has a padding issue on the left due to longer text?

@gawrysiak
Copy link
Collaborator Author

@8BallBomBom you're right, nice catch. It has been fixed in a later commit (59f52ae).

satya164 pushed a commit that referenced this pull request Jun 4, 2018
@satya164 satya164 closed this Jun 4, 2018
eriveltonelias pushed a commit to eriveltonelias/react-native-paper that referenced this pull request Sep 21, 2018
@inspireui
Copy link

Hi @gawrysiak, could you suggest how to style the actived state of Chip (with difference text color), similar this screenshot - https://user-images.githubusercontent.com/1174278/39865846-895aaf44-544e-11e8-9097-95dd3d67a525.png

Thank you!

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.

5 participants