Skip to content

Commit

Permalink
fix review useAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
faizov committed Jun 19, 2024
1 parent ef99799 commit ab6bc79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ export const GameOverModal = ({ restartGame }: any) => {
const navigate = useNavigate();

const [, setGameOver] = useAtom(GAME_OVER);
const [, setCoins] = useAtom(COINS);
const { isPending } = useApp();

const [coins] = useAtom(COINS);
const [coins, setCoins] = useAtom(COINS);
const { configState } = useGame();
const currentLevel = searchParams.get('level') as IGameLevel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Key } from 'react';
import { useAtom } from 'jotai';
import { useAtom, useSetAtom } from 'jotai';
import { useAccount } from '@gear-js/react-hooks';

import { Button, Modal } from '@/components';
Expand Down Expand Up @@ -29,7 +29,7 @@ export const GameOverModal = ({ tournamentGame }: Props) => {

const { account } = useAccount();
const [, setGameOver] = useAtom(GAME_OVER);
const [, setCoins] = useAtom(COINS);
const setCoins = useSetAtom(COINS);
const [prizePool] = useAtom(PRIZE_POOL);
const { isPending, setIsPending } = useApp();
const { setPreviousGame } = useGame();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Modal } from '@/components/ui/modal/modal2';
import { COINS } from '@/feature/game/consts';
import { Button } from '@gear-js/vara-ui';
import { useAtom } from 'jotai';
import { useSetAtom } from 'jotai';

type GamePlayAgainModalProps = {
setIsOpenPlayAgain: (_: boolean) => void;
restartGame: () => void;
};

export const GamePlayAgainModal = ({ setIsOpenPlayAgain, restartGame }: GamePlayAgainModalProps) => {
const [, setCoins] = useAtom(COINS);
const setCoins = useSetAtom(COINS);

return (
<Modal open={true}>
Expand Down

0 comments on commit ab6bc79

Please sign in to comment.