import React from 'react' import Input from '../Input' import Button from '../Button' import ListSetting from '../ListSetting' import Popout from '../Popout' import ColorPicker from '../ColorPicker' import { HIGHLIGHT_KEYS, COLORS } from '../../lib/constants' import { capitalize, stringifyRGBA, generateId } from '../../lib/util' const colorPickerStyle = { backgroundColor: COLORS.BLACK, padding: 0, margin: '4px' } const colorPresets = [] const HighlightPicker = ({ title, onChange, color }) => (
{title}
) const getCustomName = themes => `Custom Theme ${themes.filter(({ name }) => name.startsWith('Custom Theme')).length + 1}` const ThemeCreate = ({ theme, themes, highlights, create, updateHighlights }) => { const [preset, updatePreset] = React.useState(theme.id) const [highlight, selectHighlight] = React.useState() const [name, updateName] = React.useState(getCustomName(themes)) return (
Name updateName(value)} maxLength="32" />
selectHighlight(null)} onChange={id => { updatePreset(id) updateHighlights(themes.find(t => t.id === id).highlights) }} > {({ name }) => {name}}
{HIGHLIGHT_KEYS.map(key => (
))}
{highlight && ( updateHighlights({ [highlight]: stringifyRGBA(rgb) })} /> )}
) } export default ThemeCreate