import React from 'react' import { Hyper, BW, None } from './svg/Themes' const THEME_IMGS = [None, Hyper, BW] export default class extends React.Component { constructor(props) { super() this.state = { selected: props.selected || THEME_IMGS[0] } this.select = this.select.bind(this) } select(theme) { if (this.state.selected !== theme) { this.props.onChange(theme) this.setState({ selected: theme }) } } renderThemes() { return THEME_IMGS.map((Img, i) => (
)) } render() { return (
Theme
{ this.renderThemes() }
) } }