|
|
@ -51,6 +51,8 @@ class Themes extends React.PureComponent {
|
|
|
|
selected: null
|
|
|
|
selected: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dropdown = React.createRef()
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
const storedThemes = getThemes(localStorage) || []
|
|
|
|
const storedThemes = getThemes(localStorage) || []
|
|
|
|
|
|
|
|
|
|
|
@ -76,9 +78,10 @@ class Themes extends React.PureComponent {
|
|
|
|
highlights: themes.find(({ id }) => id === preset).highlights
|
|
|
|
highlights: themes.find(({ id }) => id === preset).highlights
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
|
|
handleDropdown = ({ id }) => {
|
|
|
|
handleChange = ({ id }) => {
|
|
|
|
if (id === 'create') {
|
|
|
|
if (id === 'create') {
|
|
|
|
this.props.toggleVisibility()
|
|
|
|
this.props.toggleVisibility()
|
|
|
|
|
|
|
|
this.dropdown.current.closeMenu()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.props.updateTheme(id)
|
|
|
|
this.props.updateTheme(id)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -153,13 +156,14 @@ class Themes extends React.PureComponent {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="themes">
|
|
|
|
<div className="themes">
|
|
|
|
<Dropdown
|
|
|
|
<Dropdown
|
|
|
|
|
|
|
|
innerRef={this.dropdown}
|
|
|
|
icon={themeIcon}
|
|
|
|
icon={themeIcon}
|
|
|
|
disableInput={isVisible}
|
|
|
|
disableInput={isVisible}
|
|
|
|
inputValue={dropdownValue}
|
|
|
|
inputValue={dropdownValue}
|
|
|
|
selected={dropdownValue}
|
|
|
|
selected={dropdownValue}
|
|
|
|
list={dropdownList}
|
|
|
|
list={dropdownList}
|
|
|
|
itemWrapper={this.itemWrapper}
|
|
|
|
itemWrapper={this.itemWrapper}
|
|
|
|
onChange={this.handleDropdown}
|
|
|
|
onChange={this.handleChange}
|
|
|
|
onOpen={isVisible && toggleVisibility}
|
|
|
|
onOpen={isVisible && toggleVisibility}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{isVisible && (
|
|
|
|
{isVisible && (
|
|
|
|