From 8645aad62a473375b607fef04bfc789af2882f2d Mon Sep 17 00:00:00 2001 From: George Lima Date: Mon, 10 Dec 2018 14:06:44 -0300 Subject: [PATCH] feature: add text component --- app/components/text.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/components/text.js diff --git a/app/components/text.js b/app/components/text.js new file mode 100644 index 0000000..645c553 --- /dev/null +++ b/app/components/text.js @@ -0,0 +1,37 @@ +// @flow +import React from 'react'; +import styled from 'styled-components'; + +import theme from '../theme'; + +const Text = styled.p` + font-family: ${props => props.theme.fontFamily}; + font-size: ${props => props.size}; + color: ${props => props.color || props.theme.colors.text}; + margin: 0; + padding: 0; + font-weight: ${props => (props.isBold ? 'bold' : '400')}; +`; + +type Props = { + value: string, + isBold?: boolean, + color?: string, + className?: string, + size?: string, +}; + +export const TextComponent = ({ + value, isBold, color, className, size, +}: Props) => ( + + {value} + +); + +TextComponent.defaultProps = { + className: '', + isBold: false, + color: theme.colors.text, + size: '1em', +};