mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This reverts commit af46bbf654
.
This commit is contained in:
parent
bf83fb80b7
commit
d76c056656
@ -8,29 +8,25 @@ interface Props {
|
|||||||
onColorChange: (color: string) => void;
|
onColorChange: (color: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const VizLegendSeriesIcon = React.memo<Props>(
|
/**
|
||||||
({ disabled, color, onColorChange }) => {
|
* @internal
|
||||||
return disabled ? (
|
*/
|
||||||
<SeriesIcon color={color} />
|
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ disabled, color, onColorChange }) => {
|
||||||
) : (
|
return disabled ? (
|
||||||
<SeriesColorPicker color={color} onChange={onColorChange} enableNamedColors>
|
<SeriesIcon color={color} />
|
||||||
{({ ref, showColorPicker, hideColorPicker }) => (
|
) : (
|
||||||
<SeriesIcon
|
<SeriesColorPicker color={color} onChange={onColorChange} enableNamedColors>
|
||||||
color={color}
|
{({ ref, showColorPicker, hideColorPicker }) => (
|
||||||
className="pointer"
|
<SeriesIcon
|
||||||
ref={ref}
|
color={color}
|
||||||
onClick={showColorPicker}
|
className="pointer"
|
||||||
onMouseLeave={hideColorPicker}
|
ref={ref}
|
||||||
/>
|
onClick={showColorPicker}
|
||||||
)}
|
onMouseLeave={hideColorPicker}
|
||||||
</SeriesColorPicker>
|
/>
|
||||||
);
|
)}
|
||||||
},
|
</SeriesColorPicker>
|
||||||
// areEqual -- return true if they are the same.
|
);
|
||||||
// onColorChange updates frequently, so ignore that
|
};
|
||||||
(prevProps, nextProps) => {
|
|
||||||
return prevProps.color === nextProps.color && prevProps.disabled === nextProps.disabled;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
VizLegendSeriesIcon.displayName = 'VizLegendSeriesIcon';
|
VizLegendSeriesIcon.displayName = 'VizLegendSeriesIcon';
|
||||||
|
Loading…
Reference in New Issue
Block a user