|
|
|
@ -8,8 +8,10 @@ interface Props { |
|
|
|
onColorChange: (color: string) => void; |
|
|
|
onColorChange: (color: string) => void; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const VizLegendSeriesIcon = React.memo<Props>( |
|
|
|
/** |
|
|
|
({ disabled, color, onColorChange }) => { |
|
|
|
* @internal |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ disabled, color, onColorChange }) => { |
|
|
|
return disabled ? ( |
|
|
|
return disabled ? ( |
|
|
|
<SeriesIcon color={color} /> |
|
|
|
<SeriesIcon color={color} /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
@ -25,12 +27,6 @@ export const VizLegendSeriesIcon = React.memo<Props>( |
|
|
|
)} |
|
|
|
)} |
|
|
|
</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'; |
|
|
|
|