feature: add row component

This commit is contained in:
George Lima 2018-12-10 14:05:59 -03:00
parent 7fb6fe934e
commit d5eabb634f
1 changed files with 27 additions and 0 deletions

27
app/components/row.js Normal file
View File

@ -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) => (
<Flex {...props}>{React.Children.map(children, ch => ch)}</Flex>
);
RowComponent.defaultProps = {
alignItems: 'flex-start',
justifyContent: 'flex-start',
};