Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 18 lines (16 sloc) 704 Bytes
import React from 'react';
export const makeFloatingSelector = (component) =>
(color, onClick, onMouseLeave) => {
const currentHexColor = color.hexString();
const sampleStyle = {
backgroundColor: currentHexColor
return <div onMouseLeave={onMouseLeave}>
<span style={sampleStyle} className="selection-sample"/>
<p className="color-name">{currentHexColor}</p>
<button onClick={onClick.bind(component, 'A',currentHexColor)}>Set to A</button>
<button onClick={onClick.bind(component, 'B',currentHexColor)}>Set to B</button>