diff --git a/problems/wordle-game/solutions/react-ts/src/App.tsx b/problems/wordle-game/solutions/react-ts/src/App.tsx index efdb66c..6ad8c26 100644 --- a/problems/wordle-game/solutions/react-ts/src/App.tsx +++ b/problems/wordle-game/solutions/react-ts/src/App.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import "./styles.css"; import { cn } from "./utils/cn"; @@ -13,7 +13,7 @@ const WORDS = Object.freeze([ "PASTE", "TOWER", "REACT", -]) +]); const WORD_LENGTH = 5; const MAX_TRIES = 6; @@ -28,7 +28,7 @@ enum CellColor { enum GameStatus { WON, LOST, - PLAYING + PLAYING, } type CellData = { @@ -51,15 +51,16 @@ interface CellProps { backgroundClass: CellColor; } -const Cell: React.FC = ({ value, backgroundClass }) => { +const Cell = ({ value, backgroundClass }: CellProps) => { return (
{value}
@@ -114,7 +115,7 @@ export default function App() { const submitCurrentWord = async (currentWord: string): Promise => { setIsColoring(true); let bgColorsList: CellColor[] = []; - let isMatching = currentWord === wordToGuess; + const isMatching = currentWord === wordToGuess; if (isMatching) { bgColorsList = Array(wordToGuess.length).fill(CellColor.CORRECT); @@ -200,28 +201,28 @@ export default function App() { }, [currentRow, grid, gameStatus, isColoring]); return ( -
-
-

WORDLE

+
+
+

WORDLE

{getGameStatusMessage(gameStatus, wordToGuess)}