diff --git a/client/src/components/GoodBye.tsx b/client/src/components/GoodBye.tsx deleted file mode 100644 index 7dbf6de..0000000 --- a/client/src/components/GoodBye.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react'; -import '@fontsource/roboto/300.css'; -import '@fontsource/roboto/400.css'; -import '@fontsource/roboto/500.css'; -import '@fontsource/roboto/700.css'; - -import { Box, Typography, Grid } from '@mui/material'; - - -function GoodBye({ message }) { - return ( - - - {message} - - - ) -} - -export default GoodBye diff --git a/client/src/components/InputZone.tsx b/client/src/components/InputZone.tsx deleted file mode 100644 index 3719237..0000000 --- a/client/src/components/InputZone.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import * as React from 'react'; -import { useEffect, useState } from 'react'; -import '@fontsource/roboto/300.css'; -import '@fontsource/roboto/400.css'; -import '@fontsource/roboto/500.css'; -import '@fontsource/roboto/700.css'; - -import { Typography, Button, Paper, TextField, List, ListItem } from '@mui/material'; - - -function InputZone({ index, history, messageOpen, setMessageOpen, completed, sendTactic, nbLevels, loadNextLevel, errors, lastTactic, undo, finishGame }) { - const [curInput, setCurInput] = useState("") - - const inputRef = React.createRef() - const nextRef = React.createRef() - - function handleCurInputChange(evt) { setCurInput(evt.target.value) } - - function showPrevMessage() { setMessageOpen(true) } - - useEffect(() => { - if (!messageOpen && !completed) inputRef.current.focus() - if (!messageOpen && completed && index < nbLevels) nextRef.current.focus() - if (!messageOpen && completed && index === nbLevels) finishGame() - }, [messageOpen, inputRef, nextRef, completed, finishGame, index, nbLevels]) - - async function submitForm(evt) { - evt.preventDefault(); // prevent app reloading on form submission - await sendTactic(curInput) - setCurInput(""); - } - - return ( - - Invocation zone - - {history.map((item, idx) => {item})} - -
- -
- -
- - {!messageOpen && } -
- {completed && index < nbLevels && } - -
) -} - -export default InputZone