UNPKG

shift-admin-ui-kit

Version:
34 lines (29 loc) 638 B
import React, { Component } from 'react' import classNames from 'classnames' class Image extends Component { styles () { return { height: this.props.height, width: this.props.width } } render () { let { src, className, ...otherProps } = this.props if (src) { return ( <div className={className} style={this.styles()} > <img src={src} className='o-image' {...otherProps} /> </div> ) } else { return ( <div className={classNames('o-dummy_image', className)} style={this.styles()} /> ) } } } export default Image