mirror of
https://github.com/FranP-code/Hangman-game-with-React.git
synced 2025-10-13 00:42:32 +00:00
Input for mobile users done
This commit is contained in:
@@ -21,12 +21,16 @@ const Header = ({language, category, displayCategories, setDisplayCategories}) =
|
||||
|
||||
if (category) {
|
||||
|
||||
console.log(category);
|
||||
|
||||
let categoryText = category.split('')
|
||||
categoryText[0] = categoryText[0].toUpperCase()
|
||||
if (category !== 'false') {
|
||||
|
||||
setCategoryText(categoryText)
|
||||
|
||||
console.log(category);
|
||||
|
||||
let categoryText = category.split('')
|
||||
categoryText[0] = categoryText[0].toUpperCase()
|
||||
|
||||
setCategoryText(categoryText)
|
||||
}
|
||||
}
|
||||
|
||||
}, [category])
|
||||
|
||||
19
src/components/Letter Input/LetterInput.jsx
Normal file
19
src/components/Letter Input/LetterInput.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react'
|
||||
|
||||
const LetterInput = ({registerKeys}) => {
|
||||
|
||||
const registerInput = (letter) => {
|
||||
|
||||
const input = document.getElementById('letter-input')
|
||||
|
||||
input.value = ''
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="letter-input-container">
|
||||
<input id="letter-input" type="text" onChange={(e) => registerInput(e.target.value) } />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default LetterInput
|
||||
Reference in New Issue
Block a user