1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-06-27 13:35:32 +07:00
verdaccio-ui/src/components/Label/Label.tsx
Priscila Oliveira ae73772a37 feat(eslint-config): add order rule in import
* refactor: added eslint-plugin-import

* refactor: disable some rules for muiComponents

* fix: fixed import
2019-10-07 22:19:18 +02:00

34 lines
803 B
TypeScript

import React from 'react';
import styled from 'react-emotion';
import { fontWeight } from '../../utils/styles/sizes';
interface Props {
text: string;
capitalize?: boolean;
weight?: string;
modifiers?: null | undefined;
}
interface WrapperProps {
capitalize: boolean;
weight: string;
modifiers?: null;
}
const Wrapper = styled('div')`
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 (
<Wrapper capitalize={capitalize} weight={weight} {...props}>
{text}
</Wrapper>
);
};
export default Label;