Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
faizov committed Aug 27, 2024
1 parent 3cb2a3c commit 563b05e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
3 changes: 2 additions & 1 deletion frontend/apps/vara-man/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@dapps-frontend/ui": "workspace:*",
"@gear-js/api": "0.38.1",
"@gear-js/react-hooks": "0.12.1",
"@gear-js/ui": "0.5.21",
"@gear-js/ui": "0.5.26",
"@gear-js/vara-ui": "0.0.10",
"@headlessui/react": "1.7.13",
"@mantine/form": "6.0.19",
"@polkadot/api": "11.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.header {
position: relative;
z-index: 90;
z-index: 12;
padding: 20px;

&__container {
Expand All @@ -24,6 +24,10 @@
display: none;
}
}

@media screen and (max-width: 767px) {
z-index: 10;
}
}

.wallet > button {
Expand Down
5 changes: 3 additions & 2 deletions frontend/apps/vara-man/src/feature/tournament-game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ export const Game = () => {
const isAdmin = admin === account?.decodedAddress;

if (previousGame && !tournamentGame) {
setGameOver(false);
if (!isAdmin) {
setCanceledModal(true);
} else {
setPreviousGame(null);
}
}
}, [tournamentGame]);
}, [account?.decodedAddress, previousGame, tournamentGame]);

useEffect(() => {
if (playGame || isStarted) {
Expand Down Expand Up @@ -120,7 +121,7 @@ export const Game = () => {
</div>
)}

{isFinished && tournamentGame && <GameOverModal tournamentGame={tournamentGame} />}
{isFinished && tournamentGame && !isRegistration && <GameOverModal tournamentGame={tournamentGame} />}
{isCanceledModal && <GameCanceledModal />}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export const GameLayout = ({ isPause, isCanceledModal }: Props) => {
}, [gameOver, level, isVisibleFog]);

useEffect(() => {
if (!isPause || !isCanceledModal) {
if (!isPause) {
gameInstanceRef.current?.updatePause();
}
}, [isCanceledModal, isPause]);
}, [isPause]);

useEffect(() => {
gameInstanceRef.current?.updateGameOver(gameOver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const GamePlayers = () => {
{(index === 1 || index === 2) && <SpriteIcon name="medal-line" height={24} width={24} />}
</div>
<div className="flex items-center gap-3">
<p className="font-semibold">{participant.name}</p>
<p className="font-semibold w-10 lg:w-20 text-ellipsis overflow-hidden">{participant.name}</p>
</div>
<div className="flex items-center justify-end gap-1 lg:w-full lg:mr-20">
<SpriteIcon name="game-time" height={16} width={16} />
Expand Down
13 changes: 12 additions & 1 deletion frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,16 @@ __metadata:
languageName: node
linkType: hard

"@gear-js/vara-ui@npm:0.0.10":
version: 0.0.10
resolution: "@gear-js/vara-ui@npm:0.0.10"
peerDependencies:
react: ^18.2.0
react-dom: ^18.2.0
checksum: 10c0/f8cb7cbf1e6183085386752d86d3e4ad067d308545bfed0c27e22944e11cd74cc469c57e16a288f69b9c18077285825b25c899c630028caf408662bb366b5900
languageName: node
linkType: hard

"@gear-js/vara-ui@npm:0.0.6":
version: 0.0.6
resolution: "@gear-js/vara-ui@npm:0.0.6"
Expand Down Expand Up @@ -23905,7 +23915,8 @@ __metadata:
"@dapps-frontend/ui": "workspace:*"
"@gear-js/api": "npm:0.38.1"
"@gear-js/react-hooks": "npm:0.12.1"
"@gear-js/ui": "npm:0.5.21"
"@gear-js/ui": "npm:0.5.26"
"@gear-js/vara-ui": "npm:0.0.10"
"@headlessui/react": "npm:1.7.13"
"@mantine/form": "npm:6.0.19"
"@polkadot/api": "npm:11.0.2"
Expand Down

0 comments on commit 563b05e

Please sign in to comment.