From 0f28c1282c96aec2000496b084579eb9676c0cd9 Mon Sep 17 00:00:00 2001 From: jcari-dev <582119jc@gmail.com> Date: Fri, 23 Aug 2024 15:27:52 +0000 Subject: [PATCH] added bug notifier --- chess/src/components/main/home/BugNotifier.js | 66 +++++++++++++++++++ chess/src/pages/cpu/Cpu.js | 2 + 2 files changed, 68 insertions(+) create mode 100644 chess/src/components/main/home/BugNotifier.js diff --git a/chess/src/components/main/home/BugNotifier.js b/chess/src/components/main/home/BugNotifier.js new file mode 100644 index 0000000..047e1d9 --- /dev/null +++ b/chess/src/components/main/home/BugNotifier.js @@ -0,0 +1,66 @@ +import React, { useEffect } from "react"; +import { + Modal, + ModalOverlay, + ModalContent, + ModalHeader, + ModalCloseButton, + ModalBody, + ModalFooter, + Text, + useDisclosure, + Button, +} from "@chakra-ui/react"; + +function BugNotifier() { + const OverlayOne = () => ( + + ); + + const { isOpen, onOpen, onClose } = useDisclosure(); + + useEffect(() => { + const checkServerResponse = () => { + onOpen(); + }; + + + checkServerResponse(); + }, [onOpen]); + + return ( + <> + + + + Uh Oh! + + + + Please note, there is a known rendering issue in CPU matches that + may prevent you from completing the game (but feel free to give it + a try!). + + + + This bug does not affect player vs player mode and is currently + being addressed! + + + + + + + + + ); +} + +export default BugNotifier; diff --git a/chess/src/pages/cpu/Cpu.js b/chess/src/pages/cpu/Cpu.js index 97600c8..12fd74e 100644 --- a/chess/src/pages/cpu/Cpu.js +++ b/chess/src/pages/cpu/Cpu.js @@ -21,6 +21,7 @@ import { useNavigate } from "react-router-dom"; import endpoints from "../../utils/Endpoints"; import { getCsrfToken } from "../../utils/Auth"; import { useAuth0 } from "@auth0/auth0-react"; +import BugNotifier from "../../components/main/home/BugNotifier"; function CpuDispatch() { const [difficulty, setDifficulty] = React.useState(0); @@ -80,6 +81,7 @@ function CpuDispatch() { return ( + Choose Your Difficulty