From 1c6b29d95669a76fdef3b5baa21815cbb2a8a5d2 Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Tue, 30 Aug 2016 12:57:50 -0700 Subject: [PATCH] refactor(Feed): wip customPropTypes --- .../views/Card/Content/ContentBlock.js | 4 +- .../Feed/Content/AdditionalInformation.js | 109 ++++++------ docs/app/Examples/views/Feed/Content/Date.js | 49 ------ .../views/Feed/Content/DateContent.js | 20 +++ .../views/Feed/Content/DateContentProps.js | 24 +++ .../Examples/views/Feed/Content/DateProps.js | 24 +++ .../views/Feed/Content/DateSummary.js | 53 ++---- .../views/Feed/Content/DateSummaryProps.js | 22 +++ .../Examples/views/Feed/Content/LabelIcon.js | 43 ++--- .../views/Feed/Content/LabelIconProps.js | 13 ++ .../Examples/views/Feed/Content/LabelImage.js | 42 ++--- .../views/Feed/Content/LabelImageProps.js | 13 ++ docs/app/Examples/views/Feed/Content/index.js | 38 ++++- docs/app/Examples/views/Feed/Types/Basic.js | 6 +- .../Examples/views/Feed/Types/EventsProp.js | 38 +++++ docs/app/Examples/views/Feed/Types/Props.js | 52 ------ docs/app/Examples/views/Feed/Types/index.js | 5 +- .../views/Feed/Variations/SizeLarge.js | 71 ++++---- src/lib/customPropTypes.js | 159 +++++++++++------- src/views/Card/CardGroup.js | 13 +- src/views/Feed/FeedContent.js | 7 +- src/views/Feed/FeedEvent.js | 16 +- src/views/Feed/FeedExtra.js | 7 +- src/views/Feed/FeedSummary.js | 14 +- src/views/Item/ItemGroup.js | 4 +- src/views/Statistic/StatisticGroup.js | 4 +- test/specs/views/Feed/FeedDate-test.js | 2 +- test/specs/views/Feed/FeedUser-test.js | 2 +- 28 files changed, 465 insertions(+), 389 deletions(-) delete mode 100644 docs/app/Examples/views/Feed/Content/Date.js create mode 100644 docs/app/Examples/views/Feed/Content/DateContent.js create mode 100644 docs/app/Examples/views/Feed/Content/DateContentProps.js create mode 100644 docs/app/Examples/views/Feed/Content/DateProps.js create mode 100644 docs/app/Examples/views/Feed/Content/DateSummaryProps.js create mode 100644 docs/app/Examples/views/Feed/Content/LabelIconProps.js create mode 100644 docs/app/Examples/views/Feed/Content/LabelImageProps.js create mode 100644 docs/app/Examples/views/Feed/Types/EventsProp.js delete mode 100644 docs/app/Examples/views/Feed/Types/Props.js diff --git a/docs/app/Examples/views/Card/Content/ContentBlock.js b/docs/app/Examples/views/Card/Content/ContentBlock.js index ccc9d7c22c..46c60352af 100644 --- a/docs/app/Examples/views/Card/Content/ContentBlock.js +++ b/docs/app/Examples/views/Card/Content/ContentBlock.js @@ -13,7 +13,7 @@ const ContentBlock = () => ( - + You added Jenny Hess to your coworker group. @@ -23,7 +23,7 @@ const ContentBlock = () => ( - + You added Molly Malone as a friend. diff --git a/docs/app/Examples/views/Feed/Content/AdditionalInformation.js b/docs/app/Examples/views/Feed/Content/AdditionalInformation.js index 614b9420fa..310e85c659 100644 --- a/docs/app/Examples/views/Feed/Content/AdditionalInformation.js +++ b/docs/app/Examples/views/Feed/Content/AdditionalInformation.js @@ -2,79 +2,84 @@ import _ from 'lodash' import React from 'react' import { Feed } from 'stardust' -const { Content, Event, Extra, Label, Summary } = Feed const images = _.times(2, () => 'http://semantic-ui.com/images/wireframe/image.png') const AdditionalInformation = () => { return ( - - + + + - - + + + + - - + + + + - - + + + - - + + + - - + + + + ) } diff --git a/docs/app/Examples/views/Feed/Content/Date.js b/docs/app/Examples/views/Feed/Content/Date.js deleted file mode 100644 index 2e2dd0c387..0000000000 --- a/docs/app/Examples/views/Feed/Content/Date.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react' -import { Feed } from 'stardust' - -const imageSrc = 'http://semantic-ui.com/images/avatar/small/jenny.jpg' - -const Date = () => { - return ( - - - - - 3 days ago - - You added Jenny Hess to your coworker group. - - - - - - - - - - You added Jenny Hess to your coworker group. - - - - - - - - - You added Jenny Hess to your coworker group. - - - - - - - - - - ) -} - -export default Date diff --git a/docs/app/Examples/views/Feed/Content/DateContent.js b/docs/app/Examples/views/Feed/Content/DateContent.js new file mode 100644 index 0000000000..65be0648f4 --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/DateContent.js @@ -0,0 +1,20 @@ +import React from 'react' +import { Feed } from 'stardust' + +const imageSrc = 'http://semantic-ui.com/images/avatar/small/jenny.jpg' + +const DateContent = () => ( + + + + + 3 days ago + + You added Jenny Hess to your coworker group. + + + + +) + +export default DateContent diff --git a/docs/app/Examples/views/Feed/Content/DateContentProps.js b/docs/app/Examples/views/Feed/Content/DateContentProps.js new file mode 100644 index 0000000000..650fd17da0 --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/DateContentProps.js @@ -0,0 +1,24 @@ +import React from 'react' +import { Feed } from 'stardust' + +const imageSrc = 'http://semantic-ui.com/images/avatar/small/jenny.jpg' + +const DateContentProps = () => ( + + + + + + + + +) + +export default DateContentProps diff --git a/docs/app/Examples/views/Feed/Content/DateProps.js b/docs/app/Examples/views/Feed/Content/DateProps.js new file mode 100644 index 0000000000..1a27b4218a --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/DateProps.js @@ -0,0 +1,24 @@ +import React from 'react' +import { Feed } from 'stardust' + +const imageSrc = 'http://semantic-ui.com/images/avatar/small/jenny.jpg' + +const DateProps = () => ( + + + + + + + + +) + +export default DateProps diff --git a/docs/app/Examples/views/Feed/Content/DateSummary.js b/docs/app/Examples/views/Feed/Content/DateSummary.js index ff00dbdb1f..ecb9f7766f 100644 --- a/docs/app/Examples/views/Feed/Content/DateSummary.js +++ b/docs/app/Examples/views/Feed/Content/DateSummary.js @@ -1,44 +1,21 @@ import React from 'react' import { Feed } from 'stardust' -const { Content, Date, Event, Label, Summary } = Feed -const imageSrc = 'http://semantic-ui.com/images/avatar/small/jenny.jpg' +const DateSummary = () => ( + + + + + + + + You added Jenny Hess to your coworker group. -const DateSummary = () => { - return ( - - - - - - - - - - - ) -} + 3 days ago + + + + +) export default DateSummary diff --git a/docs/app/Examples/views/Feed/Content/DateSummaryProps.js b/docs/app/Examples/views/Feed/Content/DateSummaryProps.js new file mode 100644 index 0000000000..218d30b47a --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/DateSummaryProps.js @@ -0,0 +1,22 @@ +import React from 'react' +import { Feed } from 'stardust' + +const DateSummary = () => ( + + + + + + + + +) + +export default DateSummary diff --git a/docs/app/Examples/views/Feed/Content/LabelIcon.js b/docs/app/Examples/views/Feed/Content/LabelIcon.js index 4b18d31acc..9da4a81f5c 100644 --- a/docs/app/Examples/views/Feed/Content/LabelIcon.js +++ b/docs/app/Examples/views/Feed/Content/LabelIcon.js @@ -1,29 +1,20 @@ import React from 'react' -import { Feed } from 'stardust' +import { Feed, Icon } from 'stardust' -const LabelImage = () => { - return ( - - - - - - You posted on your friend Stevie Feliciano's wall. - Today - - - +const LabelIcon = () => ( + + + + + + + + You posted on your friend Stevie Feliciano's wall. + Today + + + + +) - - - - You posted on your friend Stevie Feliciano's wall. - Today - - - - - ) -} - -export default LabelImage +export default LabelIcon diff --git a/docs/app/Examples/views/Feed/Content/LabelIconProps.js b/docs/app/Examples/views/Feed/Content/LabelIconProps.js new file mode 100644 index 0000000000..77fcb63adb --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/LabelIconProps.js @@ -0,0 +1,13 @@ +import React from 'react' +import { Feed } from 'stardust' + +const LabelIconProps = () => ( + + + + + + +) + +export default LabelIconProps diff --git a/docs/app/Examples/views/Feed/Content/LabelImage.js b/docs/app/Examples/views/Feed/Content/LabelImage.js index b772252b8d..6e6ae499b6 100644 --- a/docs/app/Examples/views/Feed/Content/LabelImage.js +++ b/docs/app/Examples/views/Feed/Content/LabelImage.js @@ -1,35 +1,17 @@ import React from 'react' import { Feed } from 'stardust' -const image = - -const LabelImage = () => { - return ( -
- - - - - - - You added Elliot Fu to the group Coworkers - - - - - - You added Elliot Fu to the group Coworkers - - - - - - You added Elliot Fu to the group Coworkers - - - -
- ) -} +const LabelImage = () => ( + + + + + + + You added Elliot Fu to the group Coworkers + + + +) export default LabelImage diff --git a/docs/app/Examples/views/Feed/Content/LabelImageProps.js b/docs/app/Examples/views/Feed/Content/LabelImageProps.js new file mode 100644 index 0000000000..8105dd45c3 --- /dev/null +++ b/docs/app/Examples/views/Feed/Content/LabelImageProps.js @@ -0,0 +1,13 @@ +import React from 'react' +import { Feed } from 'stardust' + +const LabelImageProps = () => ( + + + + + + +) + +export default LabelImageProps diff --git a/docs/app/Examples/views/Feed/Content/index.js b/docs/app/Examples/views/Feed/Content/index.js index 3f58f56692..150453ec41 100644 --- a/docs/app/Examples/views/Feed/Content/index.js +++ b/docs/app/Examples/views/Feed/Content/index.js @@ -6,18 +6,42 @@ const FeedContentExamples = () => { return ( - + + + + + + - {