Skip to content

Commit 471a9ae

Browse files
committed
Fixed step11 + rem warnings
1 parent 14da2eb commit 471a9ae

File tree

8 files changed

+55
-21
lines changed

8 files changed

+55
-21
lines changed

src/pages/Step10Page.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,22 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked, onClick }) => {
6161
const Footer = ({ gameStatus, countdown, startGame, resetGame }) => {
6262
const buttonAreaContent = () => {
6363
switch(gameStatus) {
64+
// eslint-disable-next-line
6465
case GameStatus.NEW:
6566
return <button onClick={startGame}>Start Game</button>;
6667
case GameStatus.CALLENGE:
6768
// fall-through
69+
// eslint-disable-next-line
6870
case GameStatus.PLAYING:
6971
return countdown;
7072
case GameStatus.WON:
7173
// fall-through
74+
// eslint-disable-next-line
7275
case GameStatus.LOST:
7376
return <button onClick={resetGame}>Play Again</button>;
74-
}
77+
default:
78+
// fall-through
79+
}
7580
};
7681
return (
7782
<>

src/pages/Step11Page.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,21 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked, onClick }) => {
6161
const Footer = ({ gameStatus, countdown, startGame, resetGame }) => {
6262
const buttonAreaContent = () => {
6363
switch(gameStatus) {
64+
// eslint-disable-next-line
6465
case GameStatus.NEW:
6566
return <button onClick={startGame}>Start Game</button>;
6667
case GameStatus.CALLENGE:
6768
// fall-through
69+
// eslint-disable-next-line
6870
case GameStatus.PLAYING:
6971
return countdown;
7072
case GameStatus.WON:
7173
// fall-through
74+
// eslint-disable-next-line
7275
case GameStatus.LOST:
7376
return <button onClick={resetGame}>Play Again</button>;
77+
default:
78+
// fall-through
7479
}
7580
};
7681
return (
@@ -189,6 +194,7 @@ const GameGenerator = () => {
189194

190195
return (
191196
<GameSession
197+
key={gameId}
192198
cellIds={cellIds}
193199
challengeCellIds={challengeCellIds}
194200
cellWidth={cellWidth}

src/pages/Step4Page.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ const GameSession = ({
6262
cellIds,
6363
challengeCellIds,
6464
cellWidth,
65-
challengeSize,
66-
challengeSeconds,
67-
playSeconds,
68-
maxWrongAttempts,
65+
//challengeSize,
66+
//challengeSeconds,
67+
//playSeconds,
68+
//maxWrongAttempts,
6969
}) => {
7070
const [gameStatus, setGameStatus] = useState(GameStatus.NEW);
7171

src/pages/Step5Page.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ const Footer = ({ gameStatus, startGame }) => {
6060

6161
const GameSession = ({
6262
cellIds,
63-
challengeCellIds,
63+
//challengeCellIds,
6464
cellWidth,
65-
challengeSize,
66-
challengeSeconds,
67-
playSeconds,
68-
maxWrongAttempts,
65+
//challengeSize,
66+
//challengeSeconds,
67+
//playSeconds,
68+
//maxWrongAttempts,
6969
}) => {
7070
const [gameStatus, setGameStatus] = useState(GameStatus.NEW);
71-
const [pickedCellIds, setPickedCellIds] = useState([]);
72-
const [countdown, setCountdown] = useState(playSeconds);
71+
//const [pickedCellIds, setPickedCellIds] = useState([]);
72+
//const [countdown, setCountdown] = useState(playSeconds);
7373

7474
return (
7575
<div className="game">

src/pages/Step6Page.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,22 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked }) => {
6060
const Footer = ({ gameStatus, startGame, countdown }) => {
6161
const buttonAreaContent = () => {
6262
switch(gameStatus) {
63+
// eslint-disable-next-line
6364
case GameStatus.NEW:
6465
return <button onClick={startGame}>Start Game</button>;
6566
case GameStatus.CALLENGE:
6667
// fall-through
68+
// eslint-disable-next-line
6769
case GameStatus.PLAYING:
6870
return countdown;
6971
case GameStatus.WON:
7072
// fall-through
73+
// eslint-disable-next-line
7174
case GameStatus.LOST:
7275
return <button onClick={() => {/* TODO */}}>Play Again</button>;
73-
}
76+
default:
77+
// fall-through
78+
}
7479
};
7580
return (
7681
<>
@@ -84,13 +89,15 @@ const GameSession = ({
8489
cellIds,
8590
challengeCellIds,
8691
cellWidth,
87-
challengeSize,
88-
challengeSeconds,
92+
//challengeSize,
93+
//challengeSeconds,
8994
playSeconds,
90-
maxWrongAttempts,
95+
//maxWrongAttempts,
9196
}) => {
9297
const [gameStatus, setGameStatus] = useState(GameStatus.NEW);
98+
// eslint-disable-next-line
9399
const [pickedCellIds, setPickedCellIds] = useState([]);
100+
// eslint-disable-next-line
94101
const [countdown, setCountdown] = useState(playSeconds);
95102

96103
return (

src/pages/Step7Page.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,22 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked }) => {
6060
const Footer = ({ gameStatus, startGame, countdown }) => {
6161
const buttonAreaContent = () => {
6262
switch(gameStatus) {
63+
// eslint-disable-next-line
6364
case GameStatus.NEW:
6465
return <button onClick={startGame}>Start Game</button>;
6566
case GameStatus.CALLENGE:
6667
// fall-through
68+
// eslint-disable-next-line
6769
case GameStatus.PLAYING:
6870
return countdown;
6971
case GameStatus.WON:
7072
// fall-through
73+
// eslint-disable-next-line
7174
case GameStatus.LOST:
7275
return <button onClick={() => {/* TODO */}}>Play Again</button>;
73-
}
76+
default:
77+
// fall-through
78+
}
7479
};
7580
return (
7681
<>
@@ -84,12 +89,13 @@ const GameSession = ({
8489
cellIds,
8590
challengeCellIds,
8691
cellWidth,
87-
challengeSize,
92+
//challengeSize,
8893
challengeSeconds,
8994
playSeconds,
90-
maxWrongAttempts,
95+
//maxWrongAttempts,
9196
}) => {
9297
const [gameStatus, setGameStatus] = useState(GameStatus.NEW);
98+
// eslint-disable-next-line
9399
const [pickedCellIds, setPickedCellIds] = useState([]);
94100
const [countdown, setCountdown] = useState(playSeconds);
95101

src/pages/Step8Page.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,22 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked, onClick }) => {
6161
const Footer = ({ gameStatus, startGame, countdown }) => {
6262
const buttonAreaContent = () => {
6363
switch(gameStatus) {
64+
// eslint-disable-next-line
6465
case GameStatus.NEW:
6566
return <button onClick={startGame}>Start Game</button>;
6667
case GameStatus.CALLENGE:
6768
// fall-through
69+
// eslint-disable-next-line
6870
case GameStatus.PLAYING:
6971
return countdown;
7072
case GameStatus.WON:
7173
// fall-through
74+
// eslint-disable-next-line
7275
case GameStatus.LOST:
7376
return <button onClick={() => {/* TODO */}}>Play Again</button>;
74-
}
77+
default:
78+
// fall-through
79+
}
7580
};
7681
return (
7782
<>

src/pages/Step9Page.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,22 @@ const Cell = ({ width, gameStatus, isChallenge, isPicked, onClick }) => {
6161
const Footer = ({ gameStatus, countdown, startGame, resetGame }) => {
6262
const buttonAreaContent = () => {
6363
switch(gameStatus) {
64+
// eslint-disable-next-line
6465
case GameStatus.NEW:
6566
return <button onClick={startGame}>Start Game</button>;
6667
case GameStatus.CALLENGE:
6768
// fall-through
69+
// eslint-disable-next-line
6870
case GameStatus.PLAYING:
6971
return countdown;
7072
case GameStatus.WON:
7173
// fall-through
74+
// eslint-disable-next-line
7275
case GameStatus.LOST:
7376
return <button onClick={resetGame}>Play Again</button>;
74-
}
77+
default:
78+
// fall-through
79+
}
7580
};
7681
return (
7782
<>

0 commit comments

Comments
 (0)