Skip to content

Commit

Permalink
[Fix] ColorBlock component TypeError: e.color.slice(...).join is not …
Browse files Browse the repository at this point in the history
…a function (#2212)

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta committed May 2, 2023
1 parent 1380644 commit d8a5def
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/src/side-panel/layer-panel/color-selector.tsx
Expand Up @@ -52,7 +52,10 @@ export const ColorBlock = styled.div<{backgroundcolor: RGBColor}>`
width: 32px;
height: 18px;
border-radius: 1px;
background-color: ${props => `rgb(${props.backgroundcolor.slice(0, 3).join(',')})`};
background-color: ${props =>
Array.isArray(props.backgroundcolor)
? `rgb(${props.backgroundcolor.slice(0, 3).join(',')})`
: 'transparent'};
`;

export const ColorSelectorInput = styled.div<ColorSelectorInputProps>`
Expand Down

0 comments on commit d8a5def

Please sign in to comment.