From 36956a6a8b6375bbc98565768940874da353f760 Mon Sep 17 00:00:00 2001 From: Josh Habdas Date: Wed, 25 Nov 2015 09:32:59 -0600 Subject: [PATCH] Incorporating review feedback from @kyleturco --- .../elements/Segment/Types/SegmentVerticalSegmentExample.js | 2 +- .../elements/Segment/Variations/SegmentCompactGroupExample.js | 2 +- src/collections/Table/Table.js | 4 ++-- src/elements/Segment/Segments.js | 4 ++-- src/utils/customPropTypes.js | 2 +- src/views/Items/Item.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/app/Examples/elements/Segment/Types/SegmentVerticalSegmentExample.js b/docs/app/Examples/elements/Segment/Types/SegmentVerticalSegmentExample.js index 4552a8905d..c1455558af 100644 --- a/docs/app/Examples/elements/Segment/Types/SegmentVerticalSegmentExample.js +++ b/docs/app/Examples/elements/Segment/Types/SegmentVerticalSegmentExample.js @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import {Segment} from 'stardust'; -export default class SegmentVerticalExample extends Component { +export default class SegmentVerticalSegmentExample extends Component { render() { return ( diff --git a/docs/app/Examples/elements/Segment/Variations/SegmentCompactGroupExample.js b/docs/app/Examples/elements/Segment/Variations/SegmentCompactGroupExample.js index 04eba01262..625dc456fa 100644 --- a/docs/app/Examples/elements/Segment/Variations/SegmentCompactGroupExample.js +++ b/docs/app/Examples/elements/Segment/Variations/SegmentCompactGroupExample.js @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import {Segment, Segments} from 'stardust'; -export default class SegmentCompactGroupsExample extends Component { +export default class SegmentCompactGroupExample extends Component { render() { return ( diff --git a/src/collections/Table/Table.js b/src/collections/Table/Table.js index 58b1ccc6bc..e51ced0dd6 100644 --- a/src/collections/Table/Table.js +++ b/src/collections/Table/Table.js @@ -1,13 +1,13 @@ import _ from 'lodash'; import React, {Children, Component, PropTypes} from 'react'; import classNames from 'classnames'; -import {childrenOfTypesOnly} from '../../utils/customPropTypes'; +import {ofComponentTypes} from 'src/utils/customPropTypes'; import META from 'src/utils/Meta'; export default class Table extends Component { static propTypes = { basic: PropTypes.bool, - children: childrenOfTypesOnly(['TableColumn']), + children: ofComponentTypes(['TableColumn']), className: PropTypes.string, data: PropTypes.array, }; diff --git a/src/elements/Segment/Segments.js b/src/elements/Segment/Segments.js index a21b368ebe..bb920ba210 100644 --- a/src/elements/Segment/Segments.js +++ b/src/elements/Segment/Segments.js @@ -1,7 +1,7 @@ import React, {Component, PropTypes} from 'react'; import classNames from 'classnames'; import META from 'src/utils/Meta'; -import {childrenOfTypesOnly} from '../../utils/customPropTypes'; +import {ofComponentTypes} from 'src/utils/customPropTypes'; /** * A group of segments can be formatted to appear together. @@ -11,7 +11,7 @@ export default class Segments extends Component { /** * Must be of type Segment, Segments, H1, H2, H3, H4, H5, H6, Subheading or Message. */ - children: childrenOfTypesOnly(['Segment', 'Segments', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Subheader', 'Message']), + children: ofComponentTypes(['Segment', 'Segments', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Subheader', 'Message']), /** * Class name for custom styling. */ diff --git a/src/utils/customPropTypes.js b/src/utils/customPropTypes.js index 196c2b2613..d501ae8a1e 100644 --- a/src/utils/customPropTypes.js +++ b/src/utils/customPropTypes.js @@ -8,7 +8,7 @@ const customPropTypes = { * @param {Array} allowedTypes Collection of allowed Stardust component types * @returns {Array} containing children of the specified type */ - childrenOfTypesOnly: (allowedTypes) => { + ofComponentTypes: (allowedTypes) => { return (props, propName, componentName) => { const {children} = props; const disallowed = Children.map(children, child => { diff --git a/src/views/Items/Item.js b/src/views/Items/Item.js index acde08ebd3..e89e25b2cb 100644 --- a/src/views/Items/Item.js +++ b/src/views/Items/Item.js @@ -1,7 +1,7 @@ import _ from 'lodash'; import React, {Component, PropTypes} from 'react'; import classNames from 'classnames'; -import customPropTypes from '../../utils/customPropTypes'; +import {mutuallyExclusive} from 'src/utils/customPropTypes'; import META from 'src/utils/Meta'; export default class Item extends Component { @@ -9,7 +9,7 @@ export default class Item extends Component { children: PropTypes.node, className: PropTypes.string, contentClass: PropTypes.string, - description: customPropTypes.mutuallyExclusive(['children']), + description: mutuallyExclusive(['children']), extra: PropTypes.node, header: PropTypes.node, image: PropTypes.node,