fixed Code Smells from PR 1494 (#1536)

Co-authored-by: Anton Zorin <zorii4@Antons-MacBook-Pro.local>
Co-authored-by: Oleg Shur <workshur@gmail.com>
This commit is contained in:
Zorii4 2022-02-02 16:04:27 +03:00 committed by GitHub
parent f248ad1c39
commit 0b5f9283d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,24 +5,8 @@ interface TitleProps {
isOrdered?: boolean;
}
export const Title = styled.span<TitleProps>(
({ isOrderable, isOrdered, theme: { table } }) => css`
font-family: Inter, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 16px;
letter-spacing: 0em;
text-align: left;
justify-content: start;
display: flex;
align-items: center;
background: ${table.th.backgroundColor.normal};
cursor: default;
color: ${table.th.color.normal};
${isOrderable &&
css`
const orderableMixin = css(
({ theme: { table } }) => `
cursor: pointer;
padding-right: 18px;
@ -58,11 +42,11 @@ export const Title = styled.span<TitleProps>(
border-top-color: ${table.th.color.hover};
}
}
`}
`
);
${isOrderable &&
isOrdered &&
css`
const orderedMixin = css(
({ theme: { table } }) => `
color: ${table.th.color.active};
&::before {
border-bottom-color: ${table.th.color.active};
@ -70,7 +54,28 @@ export const Title = styled.span<TitleProps>(
&::after {
border-top-color: ${table.th.color.active};
}
`}
`
);
export const Title = styled.span<TitleProps>(
({ isOrderable, isOrdered, theme: { table } }) => css`
font-family: Inter, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 16px;
letter-spacing: 0em;
text-align: left;
justify-content: start;
display: flex;
align-items: center;
background: ${table.th.backgroundColor.normal};
cursor: default;
color: ${table.th.color.normal};
${isOrderable && orderableMixin}
${isOrderable && isOrdered && orderedMixin}
`
);