Skip to content

Commit

Permalink
#LobbyDesign
Browse files Browse the repository at this point in the history
- Cleaned last comment for PR
  • Loading branch information
CheBato committed Dec 17, 2024
1 parent 76727f8 commit 82d9c8c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const PlayerHand: React.FC<IPlayerHandProps> = ({
{cards.map((card) => (
<Box key={card.uuid} sx={{ flex: "0 0 auto" }}>
<GameCard
card={card} options={[]}/>
card={card}/>
</Box>
))}
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const UnitsBoard: React.FC<IUnitsBoardProps> = ({
<Grid sx={opponentGridStyle}>
{opponentUnits.map((card: ICardData) => (
<Box key={card.id} sx={{ flex: "0 0 auto" }}>
<GameCard card={card} size="square" options={[]}/>
<GameCard card={card} size="square" variant={'gameboard'}/>
</Box>
))}
</Grid>
Expand All @@ -64,7 +64,7 @@ const UnitsBoard: React.FC<IUnitsBoardProps> = ({
<Grid sx={playerGridStyle}>
{playerUnits.map((card: ICardData) => (
<Box key={card.id} sx={{ flex: "0 0 auto" }}>
<GameCard card={card} size="square" options={[]}/>
<GameCard card={card} size="square" variant={'gameboard'}/>
</Box>
))}
</Grid>
Expand Down
6 changes: 2 additions & 4 deletions src/app/_components/Lobby/Deck/Deck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ const Deck: React.FC = () => {
<GameCard
key={card.card.uuid}
card={card}
options={['counter']}
size={'lobby'}
variant={"lobby"}
onClick={() => updateDeck(['Deck', card.card.id])}
/>
))}
Expand All @@ -170,8 +169,7 @@ const Deck: React.FC = () => {
<GameCard
key={card.card.uuid}
card={card}
options={['counter']}
size={'lobby'}
variant={'lobby'}
onClick={() => updateDeck(['SideBoard', card.card.uuid])}
/>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/_sharedcomponents/Cards/CardTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export interface IServerCardData {
}
export interface IGameCardProps {
card: ICardData | IServerCardData;
size?: "standard" | "square" | "lobby";
size?: "standard" | "square";
onClick?: () => void;
options?: string[];
variant?: "lobby" | "gameboard";
}

export interface ILeaderBaseCardProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const GameCard: React.FC<IGameCardProps> = ({
card,
size = "standard",
onClick,
options,
variant,
}) => {
// const isLobbyView = path === "/lobby";
const isFaceUp = true;
Expand Down Expand Up @@ -47,7 +47,7 @@ const GameCard: React.FC<IGameCardProps> = ({
const styles = {
cardStyles: {
borderRadius: ".38em",
...(size === "lobby"
...(variant === "lobby"
? {
height: "18vh",
width: "6.7vw",
Expand Down Expand Up @@ -114,7 +114,7 @@ const GameCard: React.FC<IGameCardProps> = ({
<CardContent sx={styles.cardContentStyle}>
<Box sx={{ display: 'flex', flexDirection: 'column', height: "100%"}}>
</Box>
{options?.includes("counter") && (
{variant === "lobby" && (
<Box sx={styles.iconLayer}>
<Typography sx={styles.numberStyle}>{cardCounter}</Typography>
</Box>
Expand Down

0 comments on commit 82d9c8c

Please sign in to comment.