Update imports of NamedColorsPalette

This commit is contained in:
Dominik Prokop 2019-01-24 10:37:34 +01:00
parent 549e0993c4
commit d414e463bd
3 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import NamedColorsPicker from './NamedColorsPalette';
import { NamedColorsPalette } from './NamedColorsPalette';
import { getColorName, getColorFromHexRgbOrName } from '../../utils/namedColorsPalette';
import { ColorPickerProps, handleColorPickerPropsDeprecation } from './ColorPicker';
import { GrafanaTheme, Themeable } from '../../types';
@ -38,9 +38,9 @@ export class ColorPickerPopover extends React.Component<Props, State> {
const { color, theme } = this.props;
return activePicker === 'spectrum' ? (
<SpectrumPalette color={color} onChange={this.handleChange} theme={theme} />
<SpectrumPalette color={color} onChange={this.handleChange} theme={theme} />
) : (
<NamedColorsPicker color={getColorName(color, theme)} onChange={this.handleChange} theme={theme} />
<NamedColorsPalette color={getColorName(color, theme)} onChange={this.handleChange} theme={theme} />
);
};

View File

@ -8,7 +8,7 @@ interface NamedColorsPaletteProps extends Themeable {
onChange: (colorName: string) => void;
}
const NamedColorsPalette = ({ color, onChange, theme }: NamedColorsPaletteProps) => {
export const NamedColorsPalette = ({ color, onChange, theme }: NamedColorsPaletteProps) => {
const swatches: JSX.Element[] = [];
ColorsPalette.forEach((colors, hue) => {
swatches.push(
@ -38,4 +38,3 @@ const NamedColorsPalette = ({ color, onChange, theme }: NamedColorsPaletteProps)
);
};
export default NamedColorsPalette;

View File

@ -189,14 +189,17 @@ $arrowSize: 15px;
z-index: 0;
}
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner
{
display:block;
position:absolute;
top:0;left:0;bottom:0;right:0;
.sp-preview-inner,
.sp-alpha-inner,
.sp-thumb-inner {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.gf-color-picker__body {
padding-bottom: $arrowSize;
padding-left: 6px;