Skip to content

Commit 4103c9d

Browse files
Merge pull request #66 from qgpcybs/main
Optimizing front-end display consistency in react-app
2 parents 6b25ccd + 6f79410 commit 4103c9d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

examples/react-app/src/App.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,22 @@ function App() {
125125

126126
<div className="card">
127127
<div className="movement-buttons">
128-
<button onClick={() => move(account, Direction.Up)}>
128+
<button
129+
onClick={() =>
130+
position && position.vec.y > 0
131+
? move(account, Direction.Up)
132+
: console.log("Reach the borders of the world.")
133+
}>
129134
Move Up
130135
</button>
131136
</div>
132137
<div className="movement-buttons">
133-
<button onClick={() => move(account, Direction.Left)}>
138+
<button
139+
onClick={() =>
140+
position && position.vec.x > 0
141+
? move(account, Direction.Left)
142+
: console.log("Reach the borders of the world.")
143+
}>
134144
Move Left
135145
</button>
136146
<button onClick={() => move(account, Direction.Right)}>

examples/react-app/src/dojo/createSystemCalls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function createSystemCalls(
2626
entity: entityId,
2727
value: {
2828
player: BigInt(entityId),
29-
remaining: 10,
29+
remaining: 100,
3030
last_direction: 0,
3131
},
3232
});

0 commit comments

Comments
 (0)