@@ -11,7 +11,7 @@ export default class Item extends Component {
1111 contentClass : PropTypes . string ,
1212 description : customPropTypes . mutuallyExclusive ( [ 'children' ] ) ,
1313 extra : PropTypes . node ,
14- heading : PropTypes . node ,
14+ header : PropTypes . node ,
1515 image : PropTypes . node ,
1616 meta : PropTypes . node ,
1717 } ;
@@ -27,20 +27,33 @@ export default class Item extends Component {
2727 } ;
2828
2929 render ( ) {
30- const heading = < div className = 'header' > { this . props . heading } </ div > ;
31- const meta = < div className = 'meta' > { this . props . meta } </ div > ;
3230 const description = < div className = 'description' > { this . props . children || this . props . description } </ div > ;
3331 const extra = < div className = 'extra' > { this . props . extra } </ div > ;
32+ const header = < div className = 'header' > { this . props . header } </ div > ;
33+
34+ const imageClasses = classNames (
35+ 'sd-item-image' ,
36+ 'ui' ,
37+ this . props . image . props . className ,
38+ 'image' ,
39+ ) ;
40+ const image = (
41+ < div className = { imageClasses } >
42+ < img { ..._ . omit ( this . props . image . props , 'className' ) } />
43+ </ div >
44+ ) ;
45+ const meta = < div className = 'meta' > { this . props . meta } </ div > ;
46+
3447 const contentClass = classNames ( 'sd-item-content' , this . props . contentClass , 'content' ) ;
3548 const content = (
3649 < div className = { contentClass } >
37- { this . props . heading && heading }
50+ { this . props . header && header }
3851 { this . props . meta && meta }
39- { this . props . children && description || this . props . description && description }
52+ { ( this . props . children || this . props . description ) && description }
4053 { this . props . extra && extra }
4154 </ div >
4255 ) ;
43- const hasContent = ! ! this . props . heading || ! ! this . props . meta || ! ! this . props . extra || ! ! this . props . children
56+ const hasContent = ! ! this . props . header || ! ! this . props . meta || ! ! this . props . extra || ! ! this . props . children
4457 || ! ! this . props . description ;
4558
4659 const classes = classNames (
@@ -54,13 +67,13 @@ export default class Item extends Component {
5467 delete props . className ;
5568 delete props . description ;
5669 delete props . extra ;
57- delete props . heading ;
70+ delete props . header ;
5871 delete props . image ;
5972 delete props . meta ;
6073
6174 return (
6275 < div { ...props } className = { classes } >
63- { this . props . image }
76+ { this . props . image && image }
6477 { hasContent && content }
6578 </ div >
6679 ) ;
0 commit comments