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

"aligned" prop util and common test #285

Merged
merged 2 commits into from
Jun 25, 2016
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Jun 25, 2016

See this comment in the Container PR for the background on this PR.

This PR adds a prop util and common test for the aligned prop. This prop breaks the pattern of other props as noted in the comments and doc blocks.

<i aligned='left' />          // <i class="left aligned" />
<i aligned='right' />         // <i class="right aligned" />
<i aligned='center' />        // <i class="center aligned" />
<i aligned='justified' />     // <i class="justified" />

To support the missing aligned class only when the value is justified we now have useAlignedProp in propUtils:

const { aligned } = this.props

const classes = cx(
  useAlignedProp(aligned)
)

In tests, we assure it was implemented correctly like so:

import Foo from 'src/Foo'

common.implementsAlignedProp(Foo)

I tested the util and common test on another component in developing this PR and I'm sure as I can be that it is correct.

@codecov-io
Copy link

Current coverage is 85.69%

No coverage report found for master at b842def.

Powered by Codecov. Last updated by b842def...a0c6af4

@levithomason levithomason merged commit e5b3f21 into master Jun 25, 2016
@levithomason levithomason deleted the feature/text-alignment branch June 25, 2016 20:41
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