From d5eabb634f16250ea65675616260e81eeb0087c2 Mon Sep 17 00:00:00 2001 From: George Lima Date: Mon, 10 Dec 2018 14:05:59 -0300 Subject: [PATCH] feature: add row component --- app/components/row.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/components/row.js diff --git a/app/components/row.js b/app/components/row.js new file mode 100644 index 0000000..9fb68f3 --- /dev/null +++ b/app/components/row.js @@ -0,0 +1,27 @@ +// @flow + +import React from 'react'; +import styled from 'styled-components'; +import type { Node } from 'react'; + +const Flex = styled.div` + display: flex; + flex-direction: row; + align-items: ${props => props.alignItems}; + justify-content: ${props => props.justifyContent}; +`; + +type Props = { + alignItems?: string, + justifyContent?: string, + children: Node, +}; + +export const RowComponent = ({ children, ...props }: Props) => ( + {React.Children.map(children, ch => ch)} +); + +RowComponent.defaultProps = { + alignItems: 'flex-start', + justifyContent: 'flex-start', +};