|
|
@ -18,7 +18,7 @@ class BackgroundSelect extends React.PureComponent {
|
|
|
|
handlePickColor = ({ rgb }) => this.props.onChange({ backgroundColor: stringifyRGBA(rgb) })
|
|
|
|
handlePickColor = ({ rgb }) => this.props.onChange({ backgroundColor: stringifyRGBA(rgb) })
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { color, mode, image, onChange, aspectRatio, isVisible, toggleVisibility } = this.props
|
|
|
|
const { color, mode, image, onChange, isVisible, toggleVisibility, carbonRef } = this.props
|
|
|
|
|
|
|
|
|
|
|
|
let background = typeof color === 'string' ? escape(color).replace(/\//g, '/') : color
|
|
|
|
let background = typeof color === 'string' ? escape(color).replace(/\//g, '/') : color
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +26,8 @@ class BackgroundSelect extends React.PureComponent {
|
|
|
|
background = DEFAULT_BG_COLOR
|
|
|
|
background = DEFAULT_BG_COLOR
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const aspectRatio = carbonRef ? carbonRef.clientWidth / carbonRef.clientHeight : 1
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="bg-select-container">
|
|
|
|
<div className="bg-select-container">
|
|
|
|
<div className={`bg-select-display ${isVisible ? 'is-visible' : ''}`}>
|
|
|
|
<div className={`bg-select-display ${isVisible ? 'is-visible' : ''}`}>
|
|
|
|