import React, { useState, useContext } from 'react'; import styled from 'styled-components'; import { ChromePicker as ColorPicker } from 'react-color'; import { ThemeContext } from './ThemeProvider'; import DefaultTheme from '@/styles/theme'; import Utils from 'utils'; import Button from 'components/button'; const ChromePicker = styled(ColorPicker)` display: inline-block; `; const Wrap = styled.div` display: inline-flex; `; const Item = styled.div` margin-right: 25px; margin-bottom: 15px; `; const Label = styled.h1` text-align: center; `; const ButtonPad = styled.div` button { margin-right: 10px; margin-bottom: 10px; } `; export default () => { const [current, setCurrent] = useState('brand'); const [theme, setTheme] = useContext(ThemeContext); return ( { setTheme({ ...theme, ...{ [current]: color.hex } }); }} /> { setTheme({ ...theme, ...{ [current + 'Hover']: color.hex } }); }} /> { setTheme({ ...theme, ...{ [current + 'Active']: color.hex } }); }} /> ); };