Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Commit

Permalink
Create blank layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzesie2k committed Aug 22, 2019
1 parent a76d2ef commit cf5ae4d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/components/BlankLayout/BlankLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Layout } from "antd";
import * as React from "react";
import { CSSProperties, FC, useMemo } from "react";
import styles from "./blankLayout.module.css";

const {Content} = Layout;

interface BlankLayoutProps {
/**
* @default 300
*/
width?: number | string;
}

const BlankLayout: FC<BlankLayoutProps> = (props) => {
const contentStyle = useMemo((): CSSProperties => ({
maxWidth: props.width || 300,
}),[props.width]);

return (
<Layout className={styles.layout}>
<Content style={contentStyle}>
{props.children}
</Content>
</Layout>
);
};

export default BlankLayout;
6 changes: 6 additions & 0 deletions src/components/BlankLayout/blankLayout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.layout {
min-height: 100vh;
align-items: center;
justify-content: center;
flex-direction: row;
}

0 comments on commit cf5ae4d

Please sign in to comment.