wix-style-react
Version:
wix-style-react
20 lines • 935 B
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { DataHooks } from './constants';
import { classes } from './ColorPickerHistory.st.css';
const ColorPickerHistory = ({ show, current, previous, onClick }) => {
if (show) {
return (React.createElement("div", { className: classes.root, "data-hook": DataHooks.history },
React.createElement("div", { "data-hook": DataHooks.historyPrevious, style: { background: previous.hex() }, onClick: () => onClick(previous) }),
React.createElement("div", { "data-hook": DataHooks.historyCurrent, style: { background: current.hex() } })));
}
return null;
};
ColorPickerHistory.propTypes = {
show: PropTypes.bool.isRequired,
previous: PropTypes.object.isRequired,
current: PropTypes.object.isRequired,
onClick: PropTypes.func.isRequired,
};
export default ColorPickerHistory;
//# sourceMappingURL=ColorPickerHistory.js.map