diff --git a/src/components/Grid/hooks/useActions.ts b/src/components/Grid/hooks/useActions.ts index cd97f21..53caeb5 100644 --- a/src/components/Grid/hooks/useActions.ts +++ b/src/components/Grid/hooks/useActions.ts @@ -2,11 +2,19 @@ //! Imports // --------------------------------------------------------------------------------------------------------------------- +// ------------------------------------------------------ React -------------------------------------------------------- import { MouseEvent, useCallback, useState } from 'react'; -import { Difficulty, GridType } from '../../../types/game'; -import { discoverAroundCell, revealAllGrid, startGame } from '../../../utils/game'; -import { GameState } from '../../../types/gameState'; +// --------------------------------------------------------------------------------------------------------------------- + +// ------------------------------------------------------ Types -------------------------------------------------------- import { SetterOrUpdater } from 'recoil'; +import { Difficulty, GridType } from '../../../types/game'; +import { GameState } from '../../../types/gameState'; +// --------------------------------------------------------------------------------------------------------------------- + +// ------------------------------------------------------ Utils -------------------------------------------------------- +import { discoverAroundCell, revealAllGrid, startGame } from '../../../utils/game'; +// --------------------------------------------------------------------------------------------------------------------- export const useActions = (grid: GridType, setGrid: React.Dispatch>, gameState: GameState, setGameState: SetterOrUpdater) => { const [, updateGrid] = useState({}); diff --git a/src/components/Home/Home.tsx b/src/components/Home/Home.tsx index 5f5ce7e..91203d9 100644 --- a/src/components/Home/Home.tsx +++ b/src/components/Home/Home.tsx @@ -2,12 +2,18 @@ //! Imports // --------------------------------------------------------------------------------------------------------------------- -// ----------------------------------------------------- Styles -------------------------------------------------------- +// ------------------------------------------------------ React -------------------------------------------------------- import { useEffect, useRef } from 'react'; -import './styles.scss'; +// --------------------------------------------------------------------------------------------------------------------- + +// ----------------------------------------------- Context & Stockage -------------------------------------------------- +import localforage from 'localforage'; import { useRecoilState } from 'recoil'; import { gameStateAtom } from '../../contexts/gameState'; -import localforage from 'localforage'; +// --------------------------------------------------------------------------------------------------------------------- + +// ----------------------------------------------------- Styles -------------------------------------------------------- +import './styles.scss'; // --------------------------------------------------------------------------------------------------------------------- const store = localforage.createInstance({ diff --git a/src/components/Leaderboard/leaderboard.tsx b/src/components/Leaderboard/leaderboard.tsx index 7942866..ff05034 100644 --- a/src/components/Leaderboard/leaderboard.tsx +++ b/src/components/Leaderboard/leaderboard.tsx @@ -6,7 +6,7 @@ import { useEffect, useState } from 'react'; // --------------------------------------------------------------------------------------------------------------------- -// ------------------------------------------------ Recoil & Stockage -------------------------------------------------- +// ----------------------------------------------- Context & Stockage -------------------------------------------------- import localforage from 'localforage'; import { useRecoilState } from 'recoil'; import { gameStateAtom } from '../../contexts/gameState'; diff --git a/src/components/Stats/Timer/Timer.tsx b/src/components/Stats/Timer/Timer.tsx index 1679b31..5462b67 100644 --- a/src/components/Stats/Timer/Timer.tsx +++ b/src/components/Stats/Timer/Timer.tsx @@ -6,12 +6,18 @@ import { useEffect, useState } from 'react'; // --------------------------------------------------------------------------------------------------------------------- +// ----------------------------------------------------- Context ------------------------------------------------------- +import { useRecoilState } from 'recoil'; +import { gameStateAtom } from '../../../contexts/gameState'; +// --------------------------------------------------------------------------------------------------------------------- + +// ------------------------------------------------------ Utils -------------------------------------------------------- +import { saveToLocalStorage } from '../../../utils/generics'; +// --------------------------------------------------------------------------------------------------------------------- + // ----------------------------------------------------- Assets -------------------------------------------------------- import Clock from '../../../assets/clock'; import '../styles.scss'; -import { useRecoilState } from 'recoil'; -import { gameStateAtom } from '../../../contexts/gameState'; -import { saveToLocalStorage } from '../../../utils/generics'; // --------------------------------------------------------------------------------------------------------------------- const Timer = () => {