Skip to content

Commit

Permalink
Merge branch 'sivicstudio:dev' into invite_player
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinsC1O authored Oct 6, 2024
2 parents 00ab704 + ea93899 commit dfb6883
Show file tree
Hide file tree
Showing 25 changed files with 802 additions and 102 deletions.
157 changes: 84 additions & 73 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Control from "./components/Control";
import { StarknetProvider } from "./starknet-provider";
import { FiAlertTriangle, FiZap } from "react-icons/fi";
import { BoardContext, BoardType } from "./context/board-context";
import { DiceProvider } from "./context/dice-context";
import ControlWindowLayout from "./components/ControlWindows/ControlWindowLayout";
import GameHelp from "./components/ControlWindows/GameHelp";
import Toolbox from "./components/ControlWindows/Toolbox";
Expand All @@ -30,6 +31,7 @@ const App = () => {
const [activeWindow, setActiveWindow] = useState("");
const [board, setBoard] = useState<BoardType>("classic");
const [gameState, setGameState] = useState({});
const [activeCategory, setActiveCategory] = useState("BOARD");
const [options, setOptions] = useState<OptionsProps>({
gameIsOngoing: false,
playersLength: 0,
Expand All @@ -52,6 +54,10 @@ const App = () => {
setBoard(newBoard);
};

const handleCategoryClick = (category: string) => {
setActiveCategory(category);
};

const setGameData = useCallback((game: object) => {
setGameState(game);
}, []);
Expand Down Expand Up @@ -92,87 +98,92 @@ const App = () => {
}}
>
<BoardContext.Provider value={{ board, toggleBoard }}>
<div className="game-behaviour-warning">
<FiAlertTriangle size={40} style={{ marginRight: "10px" }} />
StarkLudo is still in active development{" "}
<FiZap color="yellow" size={20} />
</div>
<div className="layout-container">
<div className="mobile-header">
<Header />
<DiceProvider>
<div className="game-behaviour-warning">
<FiAlertTriangle size={40} style={{ marginRight: "10px" }} />
StarkLudo is still in active development{" "}
<FiZap color="yellow" size={20} />
</div>
<Row gutter={0}>
<Col xs={12} sm={12} md={7} lg={7}>
<Ludo />
</Col>
<Col xs={12} sm={12} md={5} lg={5}>
<div className="sidebar">
<div>
<div className="layout-container">
<div className="mobile-header">
<Header />
</div>
<Row gutter={0}>
<Col xs={12} sm={12} md={7} lg={7}>
<Ludo />
</Col>
<Col xs={12} sm={12} md={5} lg={5}>
<div className="sidebar">
<div>
<div className="desktop-header">
<Header />
</div>
<Menu />
<RestartGame />
<Alert />
<Dice />
{activeWindow === "account" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="PROFILE"
subtitle="Your Profile Information"
>
<GameAccount />
</ControlWindowLayout>
) : null}
<div>
<div className="desktop-header">
<Header />
</div>
<Menu />
<RestartGame />
<Alert />
<Dice />
{activeWindow === "account" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="PROFILE"
subtitle="Your Profile Information"
>
<GameAccount />
</ControlWindowLayout>
) : null}

{activeWindow === "leaderboard" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="LEADERBOARD"
subtitle="Global Player Rankings"
>
<Leaderboard />
</ControlWindowLayout>
) : null}
{activeWindow === "leaderboard" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="LEADERBOARD"
subtitle="Global Player Rankings"
>
<Leaderboard />
</ControlWindowLayout>
) : null}

{activeWindow === "multiplayer" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="MULTIPLAYER"
subtitle="Choose An Account To Play With"
>
<Multiplayer />
</ControlWindowLayout>
) : null}
{activeWindow === "multiplayer" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="MULTIPLAYER"
subtitle="Choose An Account To Play With"
>
<Multiplayer />
</ControlWindowLayout>
) : null}

{activeWindow === "toolbox" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="TOOLBOX"
subtitle="Get All Your Items And Settings Done"
>
<Toolbox />
</ControlWindowLayout>
) : null}
{activeWindow === "toolbox" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="TOOLBOX"
subtitle="Get All Your Items And Settings Done"
>
<Toolbox
activeCategory={activeCategory}
onCategoryClick={handleCategoryClick}
/>
</ControlWindowLayout>
) : null}

{activeWindow === "help" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="HELP"
subtitle="Get Guides, Tips, And Tricks Needed For A Successful Game"
>
<GameHelp />
</ControlWindowLayout>
) : null}
<Control toggleActiveWindow={toggleActiveWindow} />
{activeWindow === "help" ? (
<ControlWindowLayout
toggle={() => setActiveWindow("")}
title="HELP"
subtitle="Get Guides, Tips, And Tricks Needed For A Successful Game"
>
<GameHelp />
</ControlWindowLayout>
) : null}
<Control toggleActiveWindow={toggleActiveWindow} />
</div>
</div>
</div>
</div>
</Col>
</Row>
<Footer />
</div>
</Col>
</Row>
<Footer />
</div>
</DiceProvider>
</BoardContext.Provider>
</GameContext.Provider>
<ToastContainer position="bottom-center" />
Expand Down
9 changes: 9 additions & 0 deletions client/src/assets/images/dice-10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions client/src/assets/images/dice-5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions client/src/assets/images/dice-6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions client/src/assets/images/dice-7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions client/src/assets/images/dice-8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions client/src/assets/images/dice-9.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dfb6883

Please sign in to comment.