import React from 'react' import Checkmark from './svg/Checkmark' import { EXPORT_SIZES, COLORS } from '../lib/constants' class ExportSizeSelect extends React.Component { constructor(props) { super(props) this.state = { isVisible: false } this.select = this.select.bind(this) this.toggle = this.toggle.bind(this) } select(exportSize) { if (this.props.selected !== exportSize) { this.props.onChange(exportSize) } } toggle() { this.setState({ isVisible: !this.state.isVisible }) } renderExportSizes() { return EXPORT_SIZES.map(exportSize => (
{exportSize.name} {this.props.selected === exportSize.id ? : null}
)) } render() { const selectedExportSize = EXPORT_SIZES.filter(exportSize => exportSize.id === this.props.selected)[0] || {} return (
Export size {selectedExportSize.name}
{this.renderExportSizes()}
) } } export default ExportSizeSelect