import * as React from 'react'; import { BackgroundControlsProps } from '../types/controls'; import { ModeEnum } from '../types/modeEnum'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Switch from '@material-ui/core/Switch'; import ColorComponent from './sub/Color'; import LinearGradientComponent from './sub/LinearGradient'; import ImageComponent from './sub/Image'; // import { BottomToolbar } from 'ory-editor-ui'; // import ThemeProvider, { darkTheme } from 'ory-editor-ui/lib/ThemeProvider'; import Tabs from '@material-ui/core/Tabs'; import Tab from '@material-ui/core/Tab'; import ImageIcon from '@material-ui/icons/Landscape'; import ColorIcon from '@material-ui/icons/ColorLens'; import GradientIcon from '@material-ui/icons/Gradient'; import Typography from '@material-ui/core/Typography'; import Slider from '@material-ui/lab/Slider'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; const styles = theme => ({ colorSecondary: { color: '#0290ff', }, bar: { backgroundColor: '#0290ff' }, iconChecked: { color: '#0290ff' }, tabIndicator: { backgroundColor: '#0290ff' }, sliderThumb: { backgroundColor: '#0290ff' }, sliderActivated: { backgroundColor: '#0290ff' }, track: { backgroundColor: '#0290ff' }, body1: { fontSize: "12px", letterSpacing: "0.35px", color: "#2f343d", display: "block", margin: "8px 0" } }); export interface BackgroundDefaultControlsState { mode: ModeEnum; } class BackgroundDefaultControls extends React.Component< BackgroundControlsProps, BackgroundDefaultControlsState > { constructor(props: BackgroundControlsProps) { super(props); this.state = { mode: props.defaultMode, }; } public render() { const { Renderer, focused, readOnly, state: { hasPadding = this.props.defaultHasPadding, modeFlag = this.props.defaultModeFlag, darken = this.props.defaultDarken, lighten = this.props.defaultLighten, }, classes } = this.props; let darkenFinal = this.props.darkenPreview !== undefined ? this.props.darkenPreview : darken; let lightenFinal = this.props.lightenPreview !== undefined ? this.props.lightenPreview : lighten; const propertiesDom = (