From c67335170afdf90244967ac659fbe1dfd85203c9 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Thu, 23 Aug 2018 15:58:36 +0200 Subject: [PATCH] Create "Paragraph" component for "

" element --- src/js/components/Paragraph/index.js | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/js/components/Paragraph/index.js diff --git a/src/js/components/Paragraph/index.js b/src/js/components/Paragraph/index.js new file mode 100644 index 00000000..775fed3e --- /dev/null +++ b/src/js/components/Paragraph/index.js @@ -0,0 +1,32 @@ +import React from 'react'; +import styled, { css } from 'styled-components'; +import PropTypes from 'prop-types'; +import colors from 'config/colors'; +import { FONT_SIZE, LINE_HEIGHT } from 'config/variables'; + +const Wrapper = styled.p` + font-size: ${FONT_SIZE.BASE}; + line-height: ${LINE_HEIGHT.BASE}; + color: ${colors.TEXT_SECONDARY}; + + ${props => props.isSmaller && css` + font-size: ${FONT_SIZE.SMALLER}; + `} +`; + +const P = ({ children, className, isSmaller = false }) => ( + {children} + +); + +P.propTypes = { + className: PropTypes.string, + children: PropTypes.string.isRequired, + isSmaller: PropTypes.bool, +}; + + +export default P; \ No newline at end of file