Skip to content

Commit

Permalink
feat(Image) Add inline prop (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and levithomason committed Aug 14, 2016
1 parent 8716116 commit e1bbafd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Icon, Image, Statistic } from 'stardust'

const { Group, Label, Value } = Statistic

// TODO: Update <Image> usage after <Image> will be updated to v1 API

const StatisticValueExample = () => (
<Group>
<Statistic>
Expand All @@ -30,7 +28,7 @@ const StatisticValueExample = () => (

<Statistic>
<Value>
<Image src='http://semantic-ui.com/images/avatar/small/joe.jpg' className='circular inline' />
<Image inline shape='circular' src='http://semantic-ui.com/images/avatar/small/joe.jpg' />
42
</Value>
<Label>Team Members</Label>
Expand Down
6 changes: 5 additions & 1 deletion src/elements/Image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import ImageGroup from './ImageGroup'
function Image(props) {
const {
verticalAlign, alt, avatar, bordered, centered, className, disabled, floated, fluid,
hidden, height, href, shape, size, spaced, src, width, wrapped,
hidden, height, href, inline, shape, size, spaced, src, width, wrapped,
} = props

const classes = cx(
Expand All @@ -33,6 +33,7 @@ function Image(props) {
useValueAndKey(floated, 'floated'),
useKeyOnly(fluid, 'fluid'),
useKeyOnly(hidden, 'hidden'),
useKeyOnly(inline, 'inline'),
useKeyOrValueAndKey(spaced, 'spaced'),
shape,
className,
Expand Down Expand Up @@ -119,6 +120,9 @@ Image.propTypes = {
/** Renders the Image as an <a> tag with this href */
href: PropTypes.string,

/** An image may appear inline */
inline: PropTypes.bool,

/** An image may appear rounded or circular */
shape: PropTypes.oneOf(Image._meta.props.shape),

Expand Down
1 change: 1 addition & 0 deletions test/specs/elements/Image/Image-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('Image Component', () => {
common.propKeyOnlyToClassName(Image, 'disabled')
common.propKeyOnlyToClassName(Image, 'fluid')
common.propKeyOnlyToClassName(Image, 'hidden')
common.propKeyOnlyToClassName(Image, 'inline')

common.propKeyAndValueToClassName(Image, 'floated')
common.propKeyOrValueToClassName(Image, 'spaced')
Expand Down

0 comments on commit e1bbafd

Please sign in to comment.