diff --git a/src/components/PlayGround/elements/Board/Board.tsx b/src/components/PlayGround/elements/Board/Board.tsx index 57ef733..c0d4b3f 100644 --- a/src/components/PlayGround/elements/Board/Board.tsx +++ b/src/components/PlayGround/elements/Board/Board.tsx @@ -26,6 +26,7 @@ const Board: React.FC = () => { fieldId={index} content={content} isSelectable={selectableFields.includes(index)} + currentColor={players.active.color} update={selectableFields.includes(index) ? update : undefined} showMessage={showMessage} /> diff --git a/src/components/PlayGround/elements/Board/DummyStone.tsx b/src/components/PlayGround/elements/Board/DummyStone.tsx new file mode 100644 index 0000000..3182db4 --- /dev/null +++ b/src/components/PlayGround/elements/Board/DummyStone.tsx @@ -0,0 +1,19 @@ +import { COLOR_CODE } from "@models/Board/Color"; + +type Props = { + color: COLOR_CODE; + size?: string; +}; + +const Stone: React.FC = (props) => { + const color: string = props.color === COLOR_CODE.WHITE ? "bg-slate-50/60" : "bg-slate-900/40"; + const size = props.size ?? "h-5/6 w-5/6"; + + return ( +
+ ); +}; + +export default Stone; diff --git a/src/components/PlayGround/elements/Board/Field.tsx b/src/components/PlayGround/elements/Board/Field.tsx index 5096618..07119e6 100644 --- a/src/components/PlayGround/elements/Board/Field.tsx +++ b/src/components/PlayGround/elements/Board/Field.tsx @@ -1,12 +1,14 @@ import { FieldId } from "@models/Board/Board"; import { COLOR_CODE } from "@models/Board/Color"; import Stone from "./Stone"; -import { memo } from "react"; +import { memo, useState } from "react"; +import DummyStone from "./DummyStone"; type Props = { fieldId: FieldId; content: COLOR_CODE; isSelectable: boolean; + currentColor: COLOR_CODE; update?: (fieldId: FieldId) => void; showMessage: (message: string) => void; }; @@ -15,13 +17,16 @@ const style = "bg-slate-200 rounded-sm shadow-x2s flex items-center justify-center box-content"; // eslintに怒られるため名前付き関数に変更している -const Field: React.FC = memo(function field(props) { +const Field: React.FC = memo(function Field(props) { + const [hover, setHover] = useState(false); return props.isSelectable ? ( ) : (