Files
snake/src/components/PageSection.js

31 lines
663 B
JavaScript

import React from "react";
import styled, { css } from "styled-components";
export const Content = styled.div`
${({ content }) =>
content === PageSection.content.center &&
css`
max-width: 60rem;
margin: 0 auto;
// padding: 0.5em;
`}
`;
const contentPosition = {
center: "center",
stretch: "stretch"
};
export const PageSection = ({ content, children, className } = { content: contentPosition.stretch }) => {
return (
<div className={className}>
<Content content={content}>{children}</Content>
</div>
);
};
PageSection.content = contentPosition;
PageSection.Content = Content;
export default PageSection;