Merge pull request #5 from sorrelbri/game_record

Add Kifu to Game UI
This commit is contained in:
Sorrel 2020-06-21 16:53:26 -07:00 committed by GitHub
commit 5eedd6b2e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,12 @@
import React from "react";
import "./Kifu.scss";
const Kifu = () => {
return (
<div className="Kifu">
<div className="Kifu__board"></div>
</div>
);
};
export default Kifu;

View file

@ -0,0 +1,13 @@
div.Kifu {
order: 0;
height: 10vh;
width: 8vh;
background-color: #FFF;
transform: rotate(-20deg);
div.Kifu__board {
border: 0.25vh solid #444;
width: 5vh;
height: 5vh;
margin: 1vh 2vh 2vh auto;
}
}

View file

@ -6,6 +6,7 @@ const PlayerArea = ({
handlePassClick, handlePassClick,
playerMeta, playerMeta,
turn, turn,
Kifu,
}) => { }) => {
const { stones, player, rank, captures } = playerMeta; const { stones, player, rank, captures } = playerMeta;
const isTurn = const isTurn =
@ -21,7 +22,6 @@ const PlayerArea = ({
const bowlText = () => { const bowlText = () => {
if (isTurn) return "Pass?"; if (isTurn) return "Pass?";
if (turn === 0) return "End Game?"; if (turn === 0) return "End Game?";
// return;
}; };
return ( return (
@ -32,6 +32,7 @@ const PlayerArea = ({
> >
<p>{bowlText()}</p> <p>{bowlText()}</p>
</div> </div>
{Kifu}
<div <div
className={`player-container__name-space player-container__name-space--${stones}`} className={`player-container__name-space player-container__name-space--${stones}`}
> >

View file

@ -5,6 +5,7 @@ import "./Game.scss";
import Logo from "../../components/Display/Logo/Logo"; import Logo from "../../components/Display/Logo/Logo";
import Board from "../../components/GameUI/Board/Board"; import Board from "../../components/GameUI/Board/Board";
import PlayerArea from "../../components/GameUI/PlayerArea/PlayerArea"; import PlayerArea from "../../components/GameUI/PlayerArea/PlayerArea";
import Kifu from "../../components/GameUI/Kifu/Kifu";
const Game = (props) => { const Game = (props) => {
const { state, dispatch } = props; const { state, dispatch } = props;
@ -139,6 +140,7 @@ const Game = (props) => {
? playerWhiteMeta ? playerWhiteMeta
: playerBlackMeta : playerBlackMeta
} }
Kifu={<Kifu />}
turn={state?.meta?.turn} turn={state?.meta?.turn}
/> />
</div> </div>