* refactor: 🔧 del unnecessary children type Change-Id: I3dea5e07f5401bdbdd168eb959fe361c57784167 * feat: 💄 eslint Change-Id: Ie173adeca9e3112d8cdfc1f85964332105dcb424 * feat: 🔧 add css type Change-Id: I8850c4d09b152f4d9c4d98e6eebca58bd9eecd37 * fix: 💄 ci lint Change-Id: I69ff89c7a30e2bdcd26475ec83f3f5ec143121b6
38 lines
808 B
TypeScript
38 lines
808 B
TypeScript
import * as React from "react";
|
|
import styled from "styled-components";
|
|
import breakpoint from "styled-components-breakpoint";
|
|
|
|
type Props = {
|
|
withStickyHeader?: boolean;
|
|
};
|
|
|
|
const Container = styled.div<{ withStickyHeader?: boolean }>`
|
|
width: 100%;
|
|
max-width: 100vw;
|
|
padding: ${(props) => (props.withStickyHeader ? "4px 12px" : "60px 12px")};
|
|
|
|
${breakpoint("tablet")`
|
|
padding: ${(props: any) =>
|
|
props.withStickyHeader ? "4px 60px 60px" : "60px"};
|
|
`};
|
|
`;
|
|
|
|
const Content = styled.div`
|
|
max-width: 46em;
|
|
margin: 0 auto;
|
|
|
|
${breakpoint("desktopLarge")`
|
|
max-width: 52em;
|
|
`};
|
|
`;
|
|
|
|
const CenteredContent: React.FC<Props> = ({ children, ...rest }) => {
|
|
return (
|
|
<Container {...rest}>
|
|
<Content>{children}</Content>
|
|
</Container>
|
|
);
|
|
};
|
|
|
|
export default CenteredContent;
|