Skip to content

Commit

Permalink
[Lens] Use eui component instead of custom color stops (elastic#85239)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Dec 9, 2020
1 parent de33718 commit 79138a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@
right: 0;
}

.lnsLayerPanel__paletteColor {
height: $euiSizeXS;
.lnsLayerPanel__palette {
border-radius: 0 0 ($euiBorderRadius - 1px) ($euiBorderRadius - 1px);

&::after {
border: none;
}
}

.lnsLayerPanel__dimensionLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@
*/

import React from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiColorPaletteDisplay } from '@elastic/eui';
import { AccessorConfig } from '../../../types';

export function PaletteIndicator({ accessorConfig }: { accessorConfig: AccessorConfig }) {
if (accessorConfig.triggerIcon !== 'colorBy' || !accessorConfig.palette) return null;
return (
<EuiFlexGroup className="lnsLayerPanel__paletteContainer" gutterSize="none" alignItems="center">
{accessorConfig.palette.map((color) => (
<EuiFlexItem
key={color}
className="lnsLayerPanel__paletteColor"
grow={true}
style={{
backgroundColor: color,
}}
/>
))}
</EuiFlexGroup>
<div className="lnsLayerPanel__paletteContainer">
<EuiColorPaletteDisplay
className="lnsLayerPanel__palette"
size="xs"
palette={accessorConfig.palette}
/>
</div>
);
}

0 comments on commit 79138a2

Please sign in to comment.