diff --git a/components/BackgroundSelect.js b/components/BackgroundSelect.js index d37a430..c12bc77 100644 --- a/components/BackgroundSelect.js +++ b/components/BackgroundSelect.js @@ -151,7 +151,7 @@ class BackgroundSelect extends React.Component { .picker-tab { user-select: none; cursor: pointer; - background: rgba(255, 255, 255, 0.165); + background: ${COLORS.DARK_GRAY}; width: 50%; text-align: center; padding: 8px 0; @@ -191,7 +191,7 @@ class BackgroundSelect extends React.Component { box-shadow: none; outline: none; border-radius: 2px; - background: rgba(255, 255, 255, 0.165); + background: ${COLORS.DARK_GRAY}; color: #fff !important; } diff --git a/components/Dropdown.js b/components/Dropdown.js index f0ee9cf..a1dd72c 100644 --- a/components/Dropdown.js +++ b/components/Dropdown.js @@ -1,7 +1,7 @@ import React from 'react' import Downshift from 'downshift' import matchSorter from 'match-sorter' -import ArrowDown from './svg/Arrowdown' +import { Down as ArrowDown } from './svg/Arrows' import CheckMark from './svg/Checkmark' import { COLORS } from '../lib/constants' @@ -197,7 +197,7 @@ const SelectedItem = ({ className="dropdown-display-text" />
- +
+ + ) } +) + +const TypeSettings = React.memo(({ onChange, font, size, lineHeight }) => { + return ( +
+ + + +
+ ) +}) + +const MiscSettings = React.memo(({ format, reset }) => { + return ( +
+ + + +
+ ) +}) + +const MenuButton = React.memo(({ name, select, selected }) => { + return ( + + ) +}) + +/*const Presets = React.memo(({ show, presets, toggle, create, remove }) => { + return ( +
+
+ Presets + {show && } + +
+ {show && ( +
+ {presets.map(({ id, backgroundColor, userCreated }) => ( +
+ { + userCreated ? : null + } +
+ ))} +
+ )} + +
+ ) +})*/ + +class Settings extends React.PureComponent { + state = { + isVisible: false, + selectedMenu: 'Window', + showPresets: false } - format() { - return formatCode(this.props.code) + toggleVisible = () => this.setState(toggle('isVisible')) + + togglePresets = () => this.setState(toggle('showPresets')) + + handleClickOutside = () => this.setState({ isVisible: false }) + + format = () => + formatCode(this.props.code) .then(this.props.onChange.bind(this, 'code')) .catch(() => { // create toast here in the future }) + + selectMenu = selectedMenu => () => this.setState({ selectedMenu }) + + renderContent = () => { + switch (this.state.selectedMenu) { + case 'Window': + return ( + + ) + case 'Type': + return ( + + ) + case 'Misc': + return + default: + return null + } } render() { + const { isVisible, selectedMenu } = this.state + return (
- - - - - - - - - - - - - - - - - Reset settings} - center={true} - enabled={false} - onChange={this.props.resetDefaultSettings} - /> - +
+
+ + + +
+ {this.renderContent()} +
+ diff --git a/components/Slider.js b/components/Slider.js index 2f4574c..c175076 100644 --- a/components/Slider.js +++ b/components/Slider.js @@ -1,5 +1,7 @@ import React from 'react' +import { COLORS } from '../lib/constants' + class Slider extends React.Component { constructor(props) { super(props) @@ -17,6 +19,14 @@ class Slider extends React.Component { return (
+
{this.props.label} -
diff --git a/components/ThemeSelect.js b/components/ThemeSelect.js index 2019085..cfe3207 100644 --- a/components/ThemeSelect.js +++ b/components/ThemeSelect.js @@ -47,7 +47,7 @@ class ThemeSelect extends React.Component { render() { return (
- Window theme + Theme
{this.renderThemes()}
diff --git a/components/svg/Arrowdown.js b/components/svg/Arrowdown.js deleted file mode 100644 index ea2d560..0000000 --- a/components/svg/Arrowdown.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' - -export default ({ fill }) => ( - - - -) diff --git a/components/svg/Arrows.js b/components/svg/Arrows.js new file mode 100644 index 0000000..3f76aac --- /dev/null +++ b/components/svg/Arrows.js @@ -0,0 +1,21 @@ +import React from 'react' + +const Up = ({ color = 'white' }) => ( + + + +) + +const Down = ({ color = 'white' }) => ( + + + +) + +const Right = ({ color = 'white' }) => ( + + + +) + +export { Up, Down, Right } diff --git a/components/svg/Remove.js b/components/svg/Remove.js new file mode 100644 index 0000000..cc3337e --- /dev/null +++ b/components/svg/Remove.js @@ -0,0 +1,10 @@ +import React from 'react' + +export default ({ color = 'black' }) => ( + + + +) diff --git a/lib/constants.js b/lib/constants.js index 7176f49..61ab58a 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -478,8 +478,10 @@ export const COLORS = { PRIMARY: '#F8E81C', SECONDARY: '#fff', GRAY: '#858585', + DARK_GRAY: '#393939', HOVER: '#1F1F1F', - PURPLE: '#C198FB' + PURPLE: '#C198FB', + RED: 'red' } export const DEFAULT_CODE = `const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)