index.community/frontend/src/components/atoms/Page.tsx

33 lines
643 B
TypeScript
Raw Normal View History

import * as React from "react";
import styled from "styled-components";
const Backdrop = styled.div`
position: absolute;
top: 50px;
bottom: 0;
left: 0;
right: 0;
background-color: #293742;
2019-08-30 12:44:00 +00:00
z-index: 3;
`;
2020-05-19 13:45:27 +00:00
interface ContainerProps {
2019-08-29 20:10:37 +00:00
fullWidth?: boolean;
}
2020-05-19 13:45:27 +00:00
const Container = styled.div<ContainerProps>`
max-width: ${(props) => (props.fullWidth ? "100%" : "800px")};
margin: auto;
padding: 2em;
`;
2020-05-19 13:45:27 +00:00
interface PageProps {
2019-08-29 20:10:37 +00:00
fullWidth?: boolean;
}
2020-05-19 13:45:27 +00:00
const Page: React.FC<PageProps> = ({ children, fullWidth }) => (
<Backdrop>
2019-08-29 20:10:37 +00:00
<Container fullWidth={fullWidth}>{children}</Container>
</Backdrop>
);
export default Page;