Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danbastin committed Nov 30, 2024
1 parent e2e0692 commit 0fb1df7
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/app/ClientLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
{isPageWithWebsocket ? (
<ClientProviders>
<GameProvider>
<Navbar />
{children}
</GameProvider>
</ClientProviders>
Expand Down
4 changes: 4 additions & 0 deletions src/app/GameBoard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"use client";
import React, { useState, useRef, useEffect, useContext } from "react";
import { Box, Grid2 as Grid } from "@mui/material";
import { s3ImageURL } from "../_utils/s3Assets";
import ChatDrawer from "../_components/Gameboard/_subcomponents/Overlays/ChatDrawer/ChatDrawer";
import OpponentCardTray from "../_components/Gameboard/OpponentCardTray/OpponentCardTray";
import Board from "../_components/Gameboard/Board/Board";
Expand Down Expand Up @@ -54,6 +55,9 @@ const GameBoard = () => {
mr: sidebarOpen ? `${drawerWidth}px` : "0",
height: "100vh",
position: "relative",
backgroundImage: `url(${s3ImageURL("game/board-background-1.png")})`,
backgroundSize: "cover",
backgroundPosition: "center",
};

if (!gameState || !connectedPlayer) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/_components/Gameboard/GameboardTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export interface BoardProps {
sidebarOpen: boolean;
}

export type DeckSize = number;
export interface DeckDiscardProps {
deckSize: DeckSize;
trayPlayer: string;
}

export interface ResourcesProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import Grid from "@mui/material/Grid2";
import Resources from "../_subcomponents/PlayerTray/Resources";
import PlayerHand from "../_subcomponents/PlayerTray/PlayerHand";
import DeckDiscard from "../_subcomponents/PlayerTray/DeckDiscard";
import { OpponentCardTrayProps } from "@/app/_components/Gameboard/GameboardTypes";
import { useGame } from "@/app/_contexts/Game.context";

Expand Down Expand Up @@ -44,7 +45,7 @@ const OpponentCardTray: React.FC<OpponentCardTrayProps> = ({ trayPlayer }) => {
<PlayerHand cards={gameState?.players[getOpponent(connectedPlayer)].cardPiles["hand"] || []} />
</Grid>
<Grid size={3} sx={rightColumn}>
{/* <DeckDiscard deckSize={participant.deckSize} /> */}
<DeckDiscard trayPlayer={trayPlayer} />
</Grid>
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Grid from "@mui/material/Grid2";
import Resources from "../_subcomponents/PlayerTray/Resources";
// import DeckDiscard from "../_subcomponents/PlayerTray/DeckDiscard/DeckDiscard";
import DeckDiscard from "../_subcomponents/PlayerTray/DeckDiscard";
import CardActionTray from "../_subcomponents/PlayerTray/CardActionTray";
import PlayerHand from "../_subcomponents/PlayerTray/PlayerHand";
import { PlayerCardTrayProps } from "@/app/_components/Gameboard/GameboardTypes";
Expand Down Expand Up @@ -52,7 +52,7 @@ const PlayerCardTray: React.FC<PlayerCardTrayProps> = ({
<CardActionTray />
</Grid>
<Grid size={3} sx={rightColumnStyle}>
{/* <DeckDiscard deckSize={participant.deckSize} /> */}
<DeckDiscard trayPlayer={trayPlayer} />
</Grid>
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React from "react";
import { Card, CardContent, Box, Typography } from "@mui/material";
// import GameCard from "../../../_sharedcomponents/Cards/GameCard/GameCard";
import GameCard from "../../../_sharedcomponents/Cards/GameCard/GameCard";
import { DeckDiscardProps } from "@/app/_components/Gameboard/GameboardTypes";
import { useGame } from "@/app/_contexts/Game.context";

const DeckDiscard: React.FC<DeckDiscardProps> = () => {
const DeckDiscard: React.FC<DeckDiscardProps> = (
trayPlayer
) => {

const { gameState } = useGame();
//------------------------STYLES------------------------//
const containerStyle = {
display: "flex",
Expand Down Expand Up @@ -41,7 +46,11 @@ const DeckDiscard: React.FC<DeckDiscardProps> = () => {
<Typography sx={discardTextStyle}>Discard</Typography>
</CardContent>
</Card>
{/* <GameCard deckSize={deckSize} isFaceUp={false} /> */}
<Card sx={discardCardStyle}>
<CardContent sx={cardContentStyle}>
<Typography sx={discardTextStyle}>Deck</Typography>
</CardContent>
</Card>
</Box>
);
};
Expand Down
4 changes: 0 additions & 4 deletions src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const UnitsBoard: React.FC<UnitsBoardProps> = ({
width: sidebarOpen ? "32vw" : "36vw",
ml: ".3vw",
p: "1vh",
backgroundImage: "url(/ground-board.png)",
backgroundPositionX: "45%",
backgroundPositionY: sidebarOpen ? "80%" : "90%",
backgroundSize: "200%",
};

const containerStyle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const GameCard: React.FC<GameCardProps> = ({
// };

const typographyStyle = {
fontFamily: "var(--font-barlow), sans-serif",
color: "black",
fontWeight: "400",
fontSize: isLobbyView ? "2em" : "1.6em",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ const CreateGameForm: React.FC<CreateGameFormProps> = ({
onChange={(e: ChangeEvent<HTMLInputElement>) =>
setDeckLink(e.target.value)
}
required
/>
</FormControl>

Expand Down
6 changes: 4 additions & 2 deletions src/app/_theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export const theme: Theme = createTheme({
styleOverrides: {
root: {
borderRadius: ".8rem",
padding: "1.5rem",
backdropFilter: "blur(20px)",
width: "100%",
overflow: "auto",
},
Expand All @@ -108,12 +106,16 @@ export const theme: Theme = createTheme({
props: { variant: "blue" },
style: {
backgroundColor: "#18325199",
padding: "1.5rem",
backdropFilter: "blur(20px)",
},
},
{
props: { variant: "black" },
style: {
backgroundColor: "rgb(0, 0, 0, 0.60)",
padding: "1.5rem",
backdropFilter: "blur(20px)",
},
},
]
Expand Down

0 comments on commit 0fb1df7

Please sign in to comment.