removes old ui components
This commit is contained in:
parent
cef002380f
commit
797af4448a
3 changed files with 0 additions and 98 deletions
|
|
@ -1,21 +0,0 @@
|
||||||
import { FC } from "react";
|
|
||||||
|
|
||||||
import { Player } from "../types/gameTypes";
|
|
||||||
|
|
||||||
type CardCacheProps = {
|
|
||||||
playersData: Player | undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const CardCache: FC<CardCacheProps> = ({ playersData }) => {
|
|
||||||
if (!playersData?.cardCache) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<p>Card Cache: {playersData.cardCache.value}</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CardCache;
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
import { FC } from "react";
|
|
||||||
import { socket } from "../socket";
|
|
||||||
|
|
||||||
import Action from "./Action";
|
|
||||||
import Display from "./Display";
|
|
||||||
import { Game, Player } from "../types/gameTypes";
|
|
||||||
|
|
||||||
type CardStackProps = {
|
|
||||||
gameData: Game | null;
|
|
||||||
playerData: Player;
|
|
||||||
};
|
|
||||||
|
|
||||||
const CardStack: FC<CardStackProps> = ({ gameData, playerData }) => {
|
|
||||||
const remainingInCardStack = gameData?.cardStack?.cards?.length || 0;
|
|
||||||
|
|
||||||
function drawFromCardStack() {
|
|
||||||
console.log("Draw card");
|
|
||||||
socket.emit("draw-from-card-stack", { sessionId: gameData?.sessionId });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gameData?.cardStack || remainingInCardStack <= 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Display data={playerData}>
|
|
||||||
<Action data={playerData} action={drawFromCardStack}>
|
|
||||||
Draw
|
|
||||||
</Action>
|
|
||||||
<span style={{ color: "grey", marginLeft: "5px" }}>
|
|
||||||
{remainingInCardStack} in Card Set
|
|
||||||
</span>
|
|
||||||
</Display>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CardStack;
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
import { FC } from "react";
|
|
||||||
import { socket } from "../socket";
|
|
||||||
|
|
||||||
import Action from "./Action";
|
|
||||||
import Display from "./Display";
|
|
||||||
import { Game, Player } from "../types/gameTypes";
|
|
||||||
|
|
||||||
type DepositCardsProps = {
|
|
||||||
gameData: Game | null;
|
|
||||||
playerData: Player;
|
|
||||||
};
|
|
||||||
|
|
||||||
const DepositCards: FC<DepositCardsProps> = ({ gameData, playerData }) => {
|
|
||||||
const remainingInCardStack = gameData?.cardStack?.cards?.length || 0;
|
|
||||||
const remainingInDiscardPile = gameData?.discardPile?.length || 0;
|
|
||||||
const topCardInDiscardPile =
|
|
||||||
gameData?.discardPile?.[remainingInDiscardPile - 1];
|
|
||||||
|
|
||||||
function clickDiscardPile() {
|
|
||||||
console.log("Clicked discard pile");
|
|
||||||
socket.emit("click-discard-pile", { sessionId: gameData?.sessionId });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gameData?.discardPile || remainingInCardStack <= 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Display data={playerData}>
|
|
||||||
<Action data={playerData} action={clickDiscardPile}>
|
|
||||||
{topCardInDiscardPile?.value}
|
|
||||||
</Action>
|
|
||||||
<span style={{ color: "grey", marginLeft: "5px" }}>
|
|
||||||
{remainingInDiscardPile} Discard Pile
|
|
||||||
</span>
|
|
||||||
</Display>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DepositCards;
|
|
||||||
Loading…
Reference in a new issue