Added functionality to the header

This commit is contained in:
Jori Lallo
2016-05-07 12:20:09 -07:00
parent cbe9c0b6ee
commit 3d4554caa3
4 changed files with 67 additions and 5 deletions

34
src/components/Flex.js Normal file
View File

@@ -0,0 +1,34 @@
import React from 'react';
const Flex = (props) => {
const style = {
display: 'flex',
flex: props.flex ? '1' : null,
flexDirection: props.direction,
justifyContent: props.justify,
alignItems: props.align,
};
return (
<div style={ style } {...props}>
{ props.children }
</div>
);
};
Flex.defaultProps = {
direction: 'row',
justify: null,
align: null,
flex: null,
};
Flex.propTypes = {
children: React.PropTypes.arrayOf(React.PropTypes.node).isRequired,
direction: React.PropTypes.string,
justify: React.PropTypes.string,
align: React.PropTypes.string,
flex: React.PropTypes.bool,
};
export default Flex;