Skip to content

Commit

Permalink
fix(Card): fix image shorthand (#3551)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Apr 8, 2019
1 parent 9d26779 commit ca81dd8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 4 additions & 2 deletions docs/src/examples/views/Card/Content/CardExampleImageCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { Card, Icon, Image } from 'semantic-ui-react'

const CardExampleImageCard = () => (
<Card>
<Image src='/images/avatar/large/daniel.jpg' />
<Image src='/images/avatar/large/daniel.jpg' wrapped ui={false} />
<Card.Content>
<Card.Header>Daniel</Card.Header>
<Card.Meta>Joined in 2016</Card.Meta>
<Card.Description>Daniel is a comedian living in Nashville.</Card.Description>
<Card.Description>
Daniel is a comedian living in Nashville.
</Card.Description>
</Card.Content>
<Card.Content extra>
<a>
Expand Down
6 changes: 4 additions & 2 deletions docs/src/examples/views/Card/Types/CardExampleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { Card, Icon, Image } from 'semantic-ui-react'

const CardExampleCard = () => (
<Card>
<Image src='/images/avatar/large/matthew.png' />
<Image src='/images/avatar/large/matthew.png' wrapped ui={false} />
<Card.Content>
<Card.Header>Matthew</Card.Header>
<Card.Meta>
<span className='date'>Joined in 2015</span>
</Card.Meta>
<Card.Description>Matthew is a musician living in Nashville.</Card.Description>
<Card.Description>
Matthew is a musician living in Nashville.
</Card.Description>
</Card.Content>
<Card.Content extra>
<a>
Expand Down
8 changes: 7 additions & 1 deletion src/views/Card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ export default class Card extends Component {

return (
<ElementType {...rest} className={classes} href={href} onClick={this.handleClick}>
{Image.create(image, { autoGenerateKey: false })}
{Image.create(image, {
autoGenerateKey: false,
defaultProps: {
ui: false,
wrapped: true,
},
})}
{(description || header || meta) && (
<CardContent description={description} header={header} meta={meta} />
)}
Expand Down

0 comments on commit ca81dd8

Please sign in to comment.