Skip to content

Commit

Permalink
feat(ListItem): icon/image prop renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Apr 26, 2016
1 parent 454fb9c commit e3343e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/elements/List/ListItem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { Component, PropTypes } from 'react'
import cx from 'classnames'

import META from '../../utils/Meta'
import { iconPropRenderer, imagePropRenderer } from '../../utils/propUtils'

export default class ListItem extends Component {
static propTypes = {
Expand Down Expand Up @@ -33,11 +35,13 @@ export default class ListItem extends Component {
_description
)

// wrap content for icon/image layouts
if (media) content = <div className='content'>{content}</div>

return (
<div {...rest} className={classes}>
{image || icon}
{media}
{content}
{children}
</div>
)
}
Expand Down

0 comments on commit e3343e5

Please sign in to comment.