Skip to content

Commit

Permalink
refactor: refac phase 1
Browse files Browse the repository at this point in the history
  • Loading branch information
0xibs committed Dec 31, 2024
1 parent dd7ccec commit 9f01c5a
Show file tree
Hide file tree
Showing 35 changed files with 1,269 additions and 1,931 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.5
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.9
- run: |
cd onchain
/home/runner/.config/.dojo/bin/sozo build
Expand Down
15 changes: 6 additions & 9 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
},
"dependencies": {
"@apollo/client": "^3.11.8",
"@dojoengine/core": "1.0.0",
"@dojoengine/create-burner": "1.0.0",
"@dojoengine/react": "1.0.0-alpha.14",
"@dojoengine/recs": "2.0.13",
"@dojoengine/sdk": "1.0.0",
"@dojoengine/state": "1.0.0-alpha.14",
"@dojoengine/torii-client": "1.0.0",
"@dojoengine/torii-wasm": "1.0.0",
"@dojoengine/utils": "1.0.0",
"@dojoengine/core": "1.0.7",
"@dojoengine/create-burner": "1.0.7",
"@dojoengine/sdk": "1.0.7",
"@dojoengine/torii-client": "1.0.7",
"@dojoengine/torii-wasm": "1.0.7",
"@dojoengine/utils": "1.0.7",
"@latticexyz/react": "^2.0.12",
"@latticexyz/utils": "^2.0.12",
"@starknet-react/chains": "^0.1.7",
Expand Down
482 changes: 35 additions & 447 deletions client/pnpm-lock.yaml

Large diffs are not rendered by default.

221 changes: 111 additions & 110 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ import Multiplayer from "./components/ControlWindows/Multiplayer";
import Leaderboard from "./components/ControlWindows/Leaderboard";
import GameAccount from "./components/ControlWindows/GameAccount";
import MobileResponsiveWarning from "./components/MobileResponsiveWarning";
import { StarkludoSchemaType } from "./dojo/gen/models.gen";
import { SDK } from "@dojoengine/sdk";
import { SchemaType } from "./dojo/typescript/models.gen";
import { createDojoStore, SDK } from "@dojoengine/sdk";
import Settings from "./components/Settings";
import ToolboxPage from "./components/Toolbox";
import { AvatarProvider } from "./context/avatar-context";

const App = ({ sdk }: { sdk: SDK<StarkludoSchemaType> }) => {

const App = ({ sdk }: { sdk: SDK<SchemaType> }) => {
const [activeWindow, setActiveWindow] = useState("");
const [showMobileResponsiveWarning, setShowMobileResponsiveWarning] =
useState(false);
Expand Down Expand Up @@ -127,123 +126,125 @@ const App = ({ sdk }: { sdk: SDK<StarkludoSchemaType> }) => {
<BoardContext.Provider value={{ board, toggleBoard }}>
<ColorProvider>
<DiceProvider>
<AvatarProvider>
<Routes>
<Route
path="/color-settings"
element={<ColorSettings />}
/>
<Route path="/settings" element={<Settings />} />
<Route path="/toolbox" element={<ToolboxPage />} />
<Route
path="/"
element={
<>
<div className="game-behaviour-warning">
<FiAlertTriangle size={20} />
StarkLudo is still in active development{" "}
<FiZap color="yellow" size={20} />
</div>
<div className="layout-container">
<div className="layout-stretch-lock">
<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>
<AvatarProvider>
<Routes>
<Route
path="/color-settings"
element={<ColorSettings />}
/>
<Route path="/settings" element={<Settings />} />
<Route path="/toolbox" element={<ToolboxPage />} />
<Route
path="/"
element={
<>
<div className="game-behaviour-warning">
<FiAlertTriangle size={20} />
StarkLudo is still in active development{" "}
<FiZap color="yellow" size={20} />
</div>
<div className="layout-container">
<div className="layout-stretch-lock">
<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 sdk={sdk} />
</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
activeCategory={
activeCategory
{activeWindow === "toolbox" ? (
<ControlWindowLayout
toggle={() =>
setActiveWindow("")
}
onCategoryClick={
handleCategoryClick
title="TOOLBOX"
subtitle="Get All Your Items And Settings Done"
>
<Toolbox
activeCategory={
activeCategory
}
onCategoryClick={
handleCategoryClick
}
/>
</ControlWindowLayout>
) : null}

{activeWindow === "help" && (
<GameHelp
onClose={() =>
setActiveWindow("")
}
/>
</ControlWindowLayout>
) : null}

{activeWindow === "help" && (
<GameHelp
onClose={() =>
setActiveWindow("")
)}
<Control
toggleActiveWindow={
toggleActiveWindow
}
/>
)}
<Control
toggleActiveWindow={
toggleActiveWindow
}
/>
</div>
</div>
</div>
</div>
</Col>
</Row>
</Col>
</Row>
</div>
</div>
</div>
<Footer />
</>
}
/>
</Routes>
</AvatarProvider>
<Footer />
</>
}
/>
</Routes>
</AvatarProvider>
</DiceProvider>
</ColorProvider>
</BoardContext.Provider>
Expand All @@ -257,4 +258,4 @@ const App = ({ sdk }: { sdk: SDK<StarkludoSchemaType> }) => {
);
};

export default App;
export default App;
Loading

0 comments on commit 9f01c5a

Please sign in to comment.