Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution of exercises #76

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9657db3
include outline none property
Camilo-Suarez98 Dec 29, 2023
a6e73bf
create input component
Camilo-Suarez98 Dec 29, 2023
7499ff0
include form in game component
Camilo-Suarez98 Dec 29, 2023
0cedab1
include validation in form
Camilo-Suarez98 Dec 29, 2023
f3d628c
include component to save all the words in the input
Camilo-Suarez98 Jan 2, 2024
d061e94
change quotes in class
Camilo-Suarez98 Jan 2, 2024
990b560
include state to save words in an array
Camilo-Suarez98 Jan 2, 2024
51a95c6
change way to save words in state
Camilo-Suarez98 Jan 2, 2024
c10b802
include a new function to save words typed in the input
Camilo-Suarez98 Jan 2, 2024
ae077e9
create new component to separate letters in word
Camilo-Suarez98 Jan 2, 2024
1806208
include guess component to replace map inside of component
Camilo-Suarez98 Jan 2, 2024
35ce284
create new component to manage style of cell
Camilo-Suarez98 Jan 3, 2024
3fbfa35
include prop inside of Previous word
Camilo-Suarez98 Jan 3, 2024
b909500
include cell component with props to validate word
Camilo-Suarez98 Jan 3, 2024
fd0862b
include answer prop to validate info
Camilo-Suarez98 Jan 3, 2024
81c5c6b
delete consoles from code
Camilo-Suarez98 Jan 3, 2024
60f32d6
create new component to show after end of game
Camilo-Suarez98 Jan 3, 2024
8047b22
include disable option if state isOver change
Camilo-Suarez98 Jan 3, 2024
1f82f7e
change some paddings to less values
Camilo-Suarez98 Jan 3, 2024
049d7b4
include validation is game over or user win
Camilo-Suarez98 Jan 3, 2024
c2dbbc2
include button style
Camilo-Suarez98 Jan 4, 2024
977f969
include reset button in main component
Camilo-Suarez98 Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
include reset button in main component
Camilo-Suarez98 committed Jan 4, 2024
commit 977f96922813dd20a24b2fa97e79cc40200361a7
14 changes: 14 additions & 0 deletions src/components/Game/Game.js
Original file line number Diff line number Diff line change
@@ -30,6 +30,14 @@ function Game() {
}
};

const handleResetGame = () => {
const newGame = [];

setWords(newGame);
setIsOver(false);
window.location.reload();
};

return (
<>
<PreviousWord
@@ -40,6 +48,12 @@ function Game() {
handleSaveWord={handleSaveWord}
isOver={isOver}
/>
<button
className='restart'
onClick={handleResetGame}
>
Restart
</button>
{isOver ?
<Banner
isWinner={isWinner}