import { PureComponent } from 'react';
import { ArrowBack } from '@material-ui/icons';
import Modal from 'react-modal';
import Lightbox from './Lightbox';
export default class Item extends PureComponent {
constructor() {
super();
this.state = {
showLightbox: false
};
}
render() {
const language = window.language.modals.main.marketplace.product;
if (!this.props.data.display_name) {
return null;
}
let warningHTML;
if (this.props.data.quote_api) {
warningHTML = (
- {language.quote_warning.title}
- {language.quote_warning.description}
);
}
// prevent console error
let iconsrc = window.constants.DDG_IMAGE_PROXY + this.props.data.icon;
if (!this.props.data.icon) {
iconsrc = null;
}
return (
{this.props.data.display_name}
{this.props.button}
{iconsrc ?
this.setState({ showLightbox: true })}/> : null}
- {language.version}
- {this.props.data.version}
- {language.author}
- {this.props.data.author}
{warningHTML}
this.setState({ showLightbox: false })} isOpen={this.state.showLightbox} className='Modal lightboxmodal' overlayClassName='Overlay resetoverlay' ariaHideApp={false}>
this.setState({ showLightbox: false })} img={iconsrc}/>
);
}
}