wix-style-react
Version:
wix-style-react
39 lines (34 loc) • 1.02 kB
JavaScript
import React from 'react';
import { bool, func, object } from 'prop-types';
import css from './ColorPickerHistory.scss';
var ColorPickerHistory = function ColorPickerHistory(_ref) {
var show = _ref.show,
current = _ref.current,
previous = _ref.previous,
_onClick = _ref.onClick;
if (show) {
return React.createElement(
'div',
{ className: css.root, 'data-hook': 'color-picker-history' },
React.createElement('div', {
'data-hook': 'color-picker-history-previous',
style: { background: previous.hex() },
onClick: function onClick() {
return _onClick(previous);
}
}),
React.createElement('div', {
'data-hook': 'color-picker-history-current',
style: { background: current.hex() }
})
);
}
return null;
};
ColorPickerHistory.propTypes = {
show: bool.isRequired,
previous: object.isRequired,
current: object.isRequired,
onClick: func.isRequired
};
export default ColorPickerHistory;