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

feat(Card): add textAlign prop to Card subcomponents #2038

Merged
merged 7 commits into from
Sep 11, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/specs/views/Card/CardContent-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import _ from 'lodash';
Copy link
Member

Choose a reason for hiding this comment

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

Heads up, tests are failing due to lint:

/home/ubuntu/Semantic-UI-React/test/specs/views/Card/CardContent-test.js
  1:23  error  Extra semicolon  semi

You can run npm run lint:fix to fix most errors and then push. Note that you can ignore warnings.


import { SUI } from 'src/lib'
import CardContent from 'src/views/Card/CardContent'
import CardDescription from 'src/views/Card/CardDescription'
import CardHeader from 'src/views/Card/CardHeader'
Expand All @@ -24,6 +27,6 @@ describe('CardContent', () => {
mapValueToProps: val => ({ content: val }),
})

common.implementsTextAlignProp(CardContent, ['left', 'center', 'right'])
common.implementsTextAlignProp(CardContent, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))
common.propKeyOnlyToClassName(CardContent, 'extra')
})
4 changes: 3 additions & 1 deletion test/specs/views/Card/CardDescription-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
import CardDescription from 'src/views/Card/CardDescription'
import * as common from 'test/specs/commonTests'

describe('CardDescription', () => {
common.isConformant(CardDescription)
common.rendersChildren(CardDescription)
common.implementsTextAlignProp(CardDescription, ['left', 'center', 'right'])
common.implementsTextAlignProp(CardDescription, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))

describe('description prop', () => {
it('renders child text', () => {
Expand Down
3 changes: 2 additions & 1 deletion test/specs/views/Card/CardGroup-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
Expand All @@ -10,7 +11,7 @@ describe('CardGroup', () => {
common.hasUIClassName(CardGroup)
common.rendersChildren(CardGroup)

common.implementsTextAlignProp(CardGroup, ['left', 'center', 'right'])
common.implementsTextAlignProp(CardGroup, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))
common.implementsWidthProp(CardGroup, SUI.WIDTHS, { propKey: 'itemsPerRow', canEqual: false })

common.propKeyOnlyToClassName(CardGroup, 'doubling')
Expand Down
4 changes: 3 additions & 1 deletion test/specs/views/Card/CardHeader-test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
import CardHeader from 'src/views/Card/CardHeader'
import * as common from 'test/specs/commonTests'

describe('CardHeader', () => {
common.isConformant(CardHeader)
common.rendersChildren(CardHeader)

common.implementsTextAlignProp(CardHeader, ['left', 'center', 'right'])
common.implementsTextAlignProp(CardHeader, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))

describe('description prop', () => {
it('renders child text', () => {
Expand Down
4 changes: 3 additions & 1 deletion test/specs/views/Card/CardMeta-test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
import CardMeta from 'src/views/Card/CardMeta'
import * as common from 'test/specs/commonTests'

describe('CardMeta', () => {
common.isConformant(CardMeta)
common.rendersChildren(CardMeta)

common.implementsTextAlignProp(CardMeta, ['left', 'center', 'right'])
common.implementsTextAlignProp(CardMeta, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))

describe('description prop', () => {
it('renders child text', () => {
Expand Down