hotfix: add align prop in text and fix fontSize
This commit is contained in:
parent
c0be9d5d8c
commit
514b683572
|
@ -11,6 +11,7 @@ const Text = styled.p`
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
font-weight: ${props => (props.isBold ? props.theme.fontWeight.bold : props.theme.fontWeight.default)};
|
||||
text-align: ${props => props.align};
|
||||
`;
|
||||
|
||||
type Props = {
|
||||
|
@ -19,12 +20,13 @@ type Props = {
|
|||
color?: string,
|
||||
className?: string,
|
||||
size?: string | number,
|
||||
align?: string,
|
||||
};
|
||||
|
||||
export const TextComponent = ({
|
||||
value, isBold, color, className, size,
|
||||
value, isBold, color, className, size, align,
|
||||
}: 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}
|
||||
</Text>
|
||||
);
|
||||
|
@ -33,5 +35,6 @@ TextComponent.defaultProps = {
|
|||
className: '',
|
||||
isBold: false,
|
||||
color: theme.colors.text,
|
||||
size: `${theme.fontSize.text}em`,
|
||||
size: theme.fontSize.text,
|
||||
align: 'left',
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue