-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Feed): use new component parts
- Loading branch information
1 parent
f76a355
commit 1421756
Showing
6 changed files
with
103 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import cx from 'classnames' | ||
import React, { PropTypes } from 'react' | ||
|
||
import { | ||
customPropTypes, | ||
getUnhandledProps, | ||
META, | ||
} from '../../lib' | ||
|
||
function FeedDate(props) { | ||
const { children, className, date } = props | ||
const classes = cx(className, 'date') | ||
const rest = getUnhandledProps(FeedDate, props) | ||
|
||
return <div {...rest} className={classes}>{children || date}</div> | ||
} | ||
|
||
FeedDate._meta = { | ||
name: 'FeedDate', | ||
parent: 'Feed', | ||
type: META.TYPES.VIEW, | ||
} | ||
|
||
FeedDate.propTypes = { | ||
/** Primary content of the FeedDate. Mutually exclusive with the date prop. */ | ||
children: customPropTypes.every([ | ||
customPropTypes.disallow(['date']), | ||
PropTypes.node, | ||
]), | ||
|
||
/** Classes that will be added to the FeedDate className. */ | ||
className: PropTypes.string, | ||
|
||
/** Shorthand for primary content of the FeedDate. Mutually exclusive with the children prop. */ | ||
date: customPropTypes.every([ | ||
customPropTypes.disallow(['children']), | ||
PropTypes.string, | ||
]), | ||
} | ||
|
||
export default FeedDate | ||
// import cx from 'classnames' | ||
// import React, { PropTypes } from 'react' | ||
// | ||
// import { | ||
// customPropTypes, | ||
// getUnhandledProps, | ||
// META, | ||
// } from '../../lib' | ||
// | ||
// function FeedDate(props) { | ||
// const { children, className, date } = props | ||
// const classes = cx(className, 'date') | ||
// const rest = getUnhandledProps(FeedDate, props) | ||
// | ||
// return <div {...rest} className={classes}>{children || date}</div> | ||
// } | ||
// | ||
// FeedDate._meta = { | ||
// name: 'FeedDate', | ||
// parent: 'Feed', | ||
// type: META.TYPES.VIEW, | ||
// } | ||
// | ||
// FeedDate.propTypes = { | ||
// /** Primary content of the FeedDate. Mutually exclusive with the date prop. */ | ||
// children: customPropTypes.every([ | ||
// customPropTypes.disallow(['date']), | ||
// PropTypes.node, | ||
// ]), | ||
// | ||
// /** Classes that will be added to the FeedDate className. */ | ||
// className: PropTypes.string, | ||
// | ||
// /** Shorthand for primary content of the FeedDate. Mutually exclusive with the children prop. */ | ||
// date: customPropTypes.every([ | ||
// customPropTypes.disallow(['children']), | ||
// PropTypes.string, | ||
// ]), | ||
// } | ||
// | ||
// export default FeedDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import cx from 'classnames' | ||
import React, { PropTypes } from 'react' | ||
|
||
import { | ||
customPropTypes, | ||
getUnhandledProps, | ||
META, | ||
} from '../../lib' | ||
|
||
function FeedUser(props) { | ||
const { children, className, user } = props | ||
const classes = cx(className, 'user') | ||
const rest = getUnhandledProps(FeedUser, props) | ||
|
||
return <a {...rest} className={classes}>{children || user}</a> | ||
} | ||
|
||
FeedUser._meta = { | ||
name: 'FeedUser', | ||
parent: 'Feed', | ||
type: META.TYPES.VIEW, | ||
} | ||
|
||
FeedUser.propTypes = { | ||
/** Primary content of the FeedUser. */ | ||
children: customPropTypes.every([ | ||
customPropTypes.disallow(['user']), | ||
PropTypes.node, | ||
]), | ||
|
||
/** Classes that will be added to the FeedUser className. */ | ||
className: PropTypes.string, | ||
|
||
/** Shorthand for primary content of the FeedUser. Mutually exclusive with the children prop. */ | ||
user: customPropTypes.every([ | ||
customPropTypes.disallow(['children']), | ||
PropTypes.string, | ||
]), | ||
} | ||
|
||
export default FeedUser | ||
// import cx from 'classnames' | ||
// import React, { PropTypes } from 'react' | ||
// | ||
// import { | ||
// customPropTypes, | ||
// getUnhandledProps, | ||
// META, | ||
// } from '../../lib' | ||
// | ||
// function FeedUser(props) { | ||
// const { children, className, user } = props | ||
// const classes = cx(className, 'user') | ||
// const rest = getUnhandledProps(FeedUser, props) | ||
// | ||
// return <a {...rest} className={classes}>{children || user}</a> | ||
// } | ||
// | ||
// FeedUser._meta = { | ||
// name: 'FeedUser', | ||
// parent: 'Feed', | ||
// type: META.TYPES.VIEW, | ||
// } | ||
// | ||
// FeedUser.propTypes = { | ||
// /** Primary content of the FeedUser. */ | ||
// children: customPropTypes.every([ | ||
// customPropTypes.disallow(['user']), | ||
// PropTypes.node, | ||
// ]), | ||
// | ||
// /** Classes that will be added to the FeedUser className. */ | ||
// className: PropTypes.string, | ||
// | ||
// /** Shorthand for primary content of the FeedUser. Mutually exclusive with the children prop. */ | ||
// user: customPropTypes.every([ | ||
// customPropTypes.disallow(['children']), | ||
// PropTypes.string, | ||
// ]), | ||
// } | ||
// | ||
// export default FeedUser |