simplified CenteredContent and fixed alignment issues

This commit is contained in:
Jori Lallo
2017-07-04 12:22:23 -05:00
parent 920aee223b
commit 53e4a94c07

View File

@ -4,8 +4,6 @@ import styled from 'styled-components';
type Props = {
children?: React.Element<any>,
style?: Object,
maxWidth?: string,
};
const Container = styled.div`
@ -13,20 +11,17 @@ const Container = styled.div`
margin: 40px 20px;
`;
const CenteredContent = ({
children,
maxWidth = '740px',
style,
...rest
}: Props) => {
const styles = {
maxWidth,
...style,
};
const Content = styled.div`
max-width: 740px;
margin: 0 auto;
`;
const CenteredContent = ({ children, ...rest }: Props) => {
return (
<Container style={styles} {...rest}>
{children}
<Container {...rest}>
<Content>
{children}
</Content>
</Container>
);
};