Skip to content

Commit

Permalink
Merge pull request #66 from qgpcybs/main
Browse files Browse the repository at this point in the history
Optimizing front-end display consistency in react-app
  • Loading branch information
ponderingdemocritus authored Nov 30, 2023
2 parents 6b25ccd + 6f79410 commit 4103c9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions examples/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,22 @@ function App() {

<div className="card">
<div className="movement-buttons">
<button onClick={() => move(account, Direction.Up)}>
<button
onClick={() =>
position && position.vec.y > 0
? move(account, Direction.Up)
: console.log("Reach the borders of the world.")
}>
Move Up
</button>
</div>
<div className="movement-buttons">
<button onClick={() => move(account, Direction.Left)}>
<button
onClick={() =>
position && position.vec.x > 0
? move(account, Direction.Left)
: console.log("Reach the borders of the world.")
}>
Move Left
</button>
<button onClick={() => move(account, Direction.Right)}>
Expand Down
2 changes: 1 addition & 1 deletion examples/react-app/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function createSystemCalls(
entity: entityId,
value: {
player: BigInt(entityId),
remaining: 10,
remaining: 100,
last_direction: 0,
},
});
Expand Down

0 comments on commit 4103c9d

Please sign in to comment.