hotfix: add align prop in text and fix fontSize

This commit is contained in:
George Lima 2018-12-12 18:14:41 -03:00
parent c0be9d5d8c
commit 514b683572
1 changed files with 6 additions and 3 deletions

View File

@ -11,6 +11,7 @@ const Text = styled.p`
margin: 0; margin: 0;
padding: 0; padding: 0;
font-weight: ${props => (props.isBold ? props.theme.fontWeight.bold : props.theme.fontWeight.default)}; font-weight: ${props => (props.isBold ? props.theme.fontWeight.bold : props.theme.fontWeight.default)};
text-align: ${props => props.align};
`; `;
type Props = { type Props = {
@ -19,12 +20,13 @@ type Props = {
color?: string, color?: string,
className?: string, className?: string,
size?: string | number, size?: string | number,
align?: string,
}; };
export const TextComponent = ({ export const TextComponent = ({
value, isBold, color, className, size, value, isBold, color, className, size, align,
}: Props) => ( }: Props) => (
<Text className={className} isBold={isBold} color={color} size={`${String(size)}em`}> <Text className={className} isBold={isBold} color={color} size={`${String(size)}em`} align={align}>
{value} {value}
</Text> </Text>
); );
@ -33,5 +35,6 @@ TextComponent.defaultProps = {
className: '', className: '',
isBold: false, isBold: false,
color: theme.colors.text, color: theme.colors.text,
size: `${theme.fontSize.text}em`, size: theme.fontSize.text,
align: 'left',
}; };