fix styled-components class

This commit is contained in:
AykutSarac 2022-08-27 19:19:07 +03:00
parent 42bc27aa97
commit fc65d2ef88
2 changed files with 11 additions and 4 deletions

View File

@ -22,7 +22,7 @@ const ObjectNode: React.FC<CustomNodeProps<[string, string][]>> = ({
data-x={x}
data-y={y}
key={idx}
width={width}
width={`${width - 20}px`}
value={JSON.stringify(val[1])}
>
<Styled.StyledKey objectKey>

View File

@ -83,12 +83,19 @@ export const StyledKey = styled.span<{
font-size: ${({ parent }) => parent && "14px"};
`;
export const StyledRow = styled.span<{ width: number; value: string }>`
export const StyledRow = styled.span.attrs<{
width: string;
value: string;
theme: DefaultTheme;
}>((props) => ({
style: {
width: props.width,
color: getTypeColor(props.value, props.theme),
},
}))<{ width: string; value: string; theme: DefaultTheme }>`
height: 18px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 auto;
width: ${({ width }) => `${width - 20}px`};
color: ${({ theme, value }) => getTypeColor(value, theme)};
`;