zepio/app/components/row.js

32 lines
660 B
JavaScript
Raw Normal View History

2018-12-10 09:05:59 -08:00
// @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,
2018-12-12 13:14:12 -08:00
className?: string,
2018-12-10 09:05:59 -08:00
children: Node,
2019-01-23 09:04:11 -08:00
id?: string,
2018-12-10 09:05:59 -08:00
};
export const RowComponent = ({ children, ...props }: Props) => (
<Flex {...props}>{React.Children.map(children, ch => ch)}</Flex>
);
RowComponent.defaultProps = {
alignItems: 'flex-start',
justifyContent: 'flex-start',
2018-12-12 13:14:12 -08:00
className: '',
2019-01-23 09:04:11 -08:00
id: '',
2018-12-10 09:05:59 -08:00
};