Skip to content

Commit

Permalink
Create GameLayout component
Browse files Browse the repository at this point in the history
  • Loading branch information
zourdyzou committed Aug 5, 2022
1 parent bf7e2ff commit 4a8e404
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/components/game-area/game-layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { FunctionComponent, PropsWithChildren } from "react";

import styles from "./game-section.module.scss";

export interface Props {
/**
* Top component prop
*/
top: React.ReactNode;
/**
* Children = Main game area
*/
children: React.ReactNode;
}

const WrapperContainer: FunctionComponent<PropsWithChildren> = ({ children }) => (
<div className={styles.wrapperContainer}>{children}</div>
);

const GameArea: FunctionComponent<PropsWithChildren> = ({ children }) => (
<div className={styles.gameArea}>{children}</div>
);

export const GameLayout: FunctionComponent<Props> = ({ top, children }) => {
return (
<WrapperContainer>
{top}
<GameArea>{children}</GameArea>
</WrapperContainer>
);
};
16 changes: 16 additions & 0 deletions src/components/game-area/game-section.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.wrapperContainer {
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}

.gameArea {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border: 6px solid #e3e3e3;
background-color: #e3e3e3;
}
Empty file.

0 comments on commit 4a8e404

Please sign in to comment.