mirror of
https://github.com/FranP-code/Hangman-game-with-React.git
synced 2025-10-13 00:42:32 +00:00
Victory and defeat logic done
This commit is contained in:
@@ -3,11 +3,10 @@ import Register_Input from '../../Scripts/Register input'
|
||||
import Defeat from './Defeat'
|
||||
import Victory from './Victory'
|
||||
|
||||
const PuzzleWord = ({hangmanFrame, setHangmanFrame, currentScore, setCurrentScore, setIsVictory, setIsDefeat}) => {
|
||||
const PuzzleWord = ({hangmanFrame, setHangmanFrame, currentScore, setCurrentScore, setIsVictory, setIsDefeat, setDisplayApp}) => {
|
||||
|
||||
const [actualWord, setActualWord] = useState('papa')
|
||||
|
||||
|
||||
const generatePuzzleWord = () => {
|
||||
|
||||
const puzzleWord = document.getElementById('puzzleWord')
|
||||
@@ -27,12 +26,12 @@ const PuzzleWord = ({hangmanFrame, setHangmanFrame, currentScore, setCurrentScor
|
||||
counter.textContent = '(' + actualWord.length + ')'
|
||||
|
||||
puzzleWord.appendChild(counter)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
|
||||
generatePuzzleWord()
|
||||
setDisplayApp(true)
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
12
src/components/Loading.jsx
Normal file
12
src/components/Loading.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react'
|
||||
import loadingGifLightTheme from './img/loading-light-theme.png'
|
||||
|
||||
const Loading = () => {
|
||||
return (
|
||||
<div className='loading'>
|
||||
<img src={loadingGifLightTheme} alt="" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Loading
|
||||
BIN
src/components/img/loading-dark-theme.png
Normal file
BIN
src/components/img/loading-dark-theme.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
src/components/img/loading-light-theme.png
Normal file
BIN
src/components/img/loading-light-theme.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Reference in New Issue
Block a user