1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-19 01:25:51 +07:00

fix: remove ts ignore from some components

This commit is contained in:
Antoine Chalifour
2019-10-03 13:22:36 +02:00
committed by antoinechalifour
parent 32f4389b73
commit b1804d7644
4 changed files with 15 additions and 12 deletions

View File

@@ -9,18 +9,20 @@ interface Props {
modifiers?: null | undefined;
}
interface WrapperProps {
capitalize: boolean;
weight: string;
modifiers?: null;
}
const Wrapper = styled('div')`
font-weight: ${({ weight }) => {
// @ts-ignore
return fontWeight[weight];
}};
text-transform: ${({ capitalize }) => (capitalize ? 'capitalize' : 'none')};
${({ modifiers }: Props) => modifiers && modifiers};
font-weight: ${({ weight }: WrapperProps) => fontWeight[weight]};
text-transform: ${({ capitalize }: WrapperProps) => (capitalize ? 'capitalize' : 'none')};
${({ modifiers }: WrapperProps) => modifiers};
`;
const Label: React.FC<Props> = ({ text = '', capitalize = false, weight = 'regular', ...props }) => {
return (
// @ts-ignore
<Wrapper capitalize={capitalize} weight={weight} {...props}>
{text}
</Wrapper>