import React from 'react' import { COLORS } from '../lib/constants' import Checkmark from './svg/Checkmark' import { EXPORT_SIZES } from '../lib/constants' export default class 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, i) => { return (
{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()}
) } }