diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js new file mode 100644 index 000000000..96c27d2ba --- /dev/null +++ b/src/components/Form/Form.js @@ -0,0 +1,30 @@ +import React from 'react'; + +function Form() { + const [input, setInput] = React.useState(''); + function guessing(event){ + event.preventDefault(); + console.log({input}); + setInput(''); + } + return( +
+ + ( + setInput(event.target.value.toUpperCase()) + )} + /> +
+ ); +} + +export default Form; diff --git a/src/components/Form/index.js b/src/components/Form/index.js new file mode 100644 index 000000000..be00c58fc --- /dev/null +++ b/src/components/Form/index.js @@ -0,0 +1,2 @@ +export * from './Form'; +export { default } from './Form'; diff --git a/src/components/Game/Game.js b/src/components/Game/Game.js index fc7615d24..6dcd2b665 100644 --- a/src/components/Game/Game.js +++ b/src/components/Game/Game.js @@ -2,6 +2,7 @@ import React from 'react'; import { sample } from '../../utils'; import { WORDS } from '../../data'; +import Form from '../Form/Form'; // Pick a random word on every pageload. const answer = sample(WORDS); @@ -9,7 +10,11 @@ const answer = sample(WORDS); console.info({ answer }); function Game() { - return <>Put a game here!; + return( + <> +
+ + ); } export default Game;