import React from 'react' import Toggle from './Toggle' import { None, BW, Sharp, Boxy } from './svg/WindowThemes' import { COLORS } from '../lib/constants' const WINDOW_THEMES_MAP = { none: None, sharp: Sharp, bw: BW, boxy: Boxy } class ThemeSelect extends React.Component { select = theme => { if (this.props.selected !== theme) { this.props.onChange('windowTheme', theme) } } renderThemes() { return Object.keys(WINDOW_THEMES_MAP).map(theme => { const Img = WINDOW_THEMES_MAP[theme] const checked = this.props.selected === theme return (
) }) } render() { return ( <>
this.props.onChange('windowControls', v)} /> {this.props.windowControls && (
{this.renderThemes()}
)}
) } } export default ThemeSelect