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;
|
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',
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue