simplified CenteredContent and fixed alignment issues
This commit is contained in:
@ -4,8 +4,6 @@ import styled from 'styled-components';
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children?: React.Element<any>,
|
children?: React.Element<any>,
|
||||||
style?: Object,
|
|
||||||
maxWidth?: string,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
@ -13,20 +11,17 @@ const Container = styled.div`
|
|||||||
margin: 40px 20px;
|
margin: 40px 20px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const CenteredContent = ({
|
const Content = styled.div`
|
||||||
children,
|
max-width: 740px;
|
||||||
maxWidth = '740px',
|
margin: 0 auto;
|
||||||
style,
|
`;
|
||||||
...rest
|
|
||||||
}: Props) => {
|
|
||||||
const styles = {
|
|
||||||
maxWidth,
|
|
||||||
...style,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
const CenteredContent = ({ children, ...rest }: Props) => {
|
||||||
return (
|
return (
|
||||||
<Container style={styles} {...rest}>
|
<Container {...rest}>
|
||||||
|
<Content>
|
||||||
{children}
|
{children}
|
||||||
|
</Content>
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user