import React from 'react' import enhanceWithClickOutside from 'react-click-outside' import SettingsIcon from './svg/Settings' import ThemeSelect from './ThemeSelect' import FontSelect from './FontSelect' import ExportSizeSelect from './ExportSizeSelect' import Slider from './Slider' import Toggle from './Toggle' import WindowPointer from './WindowPointer' import Collapse from './Collapse' import { COLORS } from '../lib/constants' import { formatCode } from '../lib/util' class Settings extends React.Component { constructor(props) { super(props) this.state = { isVisible: false } this.toggle = this.toggle.bind(this) this.format = this.format.bind(this) } toggle() { this.setState({ isVisible: !this.state.isVisible }) } handleClickOutside() { this.setState({ isVisible: false }) } format() { try { const newCode = formatCode(this.props.code) this.props.onChange('code', newCode) } catch (e) { // pass, create a toast here in the future. } } render() { return (