|
|
@ -15,30 +15,34 @@ class ThemeSelect extends React.Component {
|
|
|
|
renderThemes() {
|
|
|
|
renderThemes() {
|
|
|
|
return WINDOW_THEMES.map(theme => {
|
|
|
|
return WINDOW_THEMES.map(theme => {
|
|
|
|
const Img = WINDOW_THEMES_MAP[theme]
|
|
|
|
const Img = WINDOW_THEMES_MAP[theme]
|
|
|
|
|
|
|
|
const checked = this.props.selected === theme
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
role="button"
|
|
|
|
|
|
|
|
tabIndex={0}
|
|
|
|
|
|
|
|
className={`theme ${this.props.selected === theme ? 'selected' : ''}`}
|
|
|
|
|
|
|
|
key={theme}
|
|
|
|
key={theme}
|
|
|
|
|
|
|
|
role="radio"
|
|
|
|
|
|
|
|
checked={checked}
|
|
|
|
|
|
|
|
aria-checked={checked}
|
|
|
|
|
|
|
|
tabIndex={checked ? 0 : -1}
|
|
|
|
onClick={this.select.bind(null, theme)}
|
|
|
|
onClick={this.select.bind(null, theme)}
|
|
|
|
|
|
|
|
value={theme}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Img />
|
|
|
|
<Img />
|
|
|
|
<style jsx>
|
|
|
|
<style jsx>
|
|
|
|
{`
|
|
|
|
{`
|
|
|
|
.theme {
|
|
|
|
[role='radio'] {
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
margin-right: 8px;
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.theme:last-of-type {
|
|
|
|
[aria-checked='true'] :global(svg) {
|
|
|
|
margin-right: 0px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.selected :global(svg) {
|
|
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
border-radius: 3px;
|
|
|
|
border: solid 2px ${COLORS.SECONDARY};
|
|
|
|
border: solid 2px ${COLORS.SECONDARY};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[role='radio']:last-of-type {
|
|
|
|
|
|
|
|
margin-right: 0px;
|
|
|
|
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -49,8 +53,12 @@ class ThemeSelect extends React.Component {
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="window-theme">
|
|
|
|
<div className="window-theme">
|
|
|
|
<span className="label">Theme</span>
|
|
|
|
<span className="label" id="window-theme-label">
|
|
|
|
<div className="themes">{this.renderThemes()}</div>
|
|
|
|
Theme
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div className="themes" role="radiogroup" aria-labelledby="window-theme-label">
|
|
|
|
|
|
|
|
{this.renderThemes()}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<style jsx>
|
|
|
|
<style jsx>
|
|
|
|
{`
|
|
|
|
{`
|
|
|
|
.window-theme {
|
|
|
|
.window-theme {
|
|
|
|