Skip to content

Commit

Permalink
added bug notifier on cpu page
Browse files Browse the repository at this point in the history
  • Loading branch information
jcari-dev committed Aug 23, 2024
1 parent 7a1f0ed commit 95cf4da
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CHESS_9A6EC }}'
channelId: live
projectId: chess-9a6ec
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CHESS_9A6EC }}'
projectId: chess-9a6ec
27 changes: 27 additions & 0 deletions chess/.firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
asset-manifest.json,1712959998732,1e94c21131a75c36abceca4e3d8e117878ff460c06056c1143c1caf2e20f0a08
favicon.ico,1711736324657,f1f5a278586dc5e87cd75981cfb72b4435b20327a8720ea2211bd34094800eb0
index.html,1712959998710,841962ed6b40d6fe6df6cb832b3022841c26699a83f3978e4f0c9f54fd83ddc7
logo192.png,1711736324658,79e2b749561016bc8af300ea19f48347ceed3cb1a54f48ae456172eca45e08f0
logo512.png,1711736324659,212b102aa09e51b3b3e06647e81f7801a61333e171f6582e8124379aabccb41d
manifest.json,1711736324659,4368aeaf848ae2e048765562c289452f33ad2a175c4b1951ea8bdf2ada0d5b10
robots.txt,1711736324660,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
static/css/main.e6c13ad2.css,1712959998716,10675dc14dd390bf45eef8a0221880c7b5b9a5ac519a13bc0890261e6b1e84fa
static/css/main.e6c13ad2.css.map,1712959998732,2ae530ffcbabb29dfa42374a8ec003f5e9455675377277db91abc65b67d3b1e5
static/js/453.8411124a.chunk.js,1712959998732,da511f0b4035cd33477a13176f9035dd5c91e127e6bd627a6e2b0d6436b2b7c1
static/js/453.8411124a.chunk.js.map,1712959998733,00f86ccfefa56fe6adb3bfd86a759eaaa0624e7bf426f5cbc533d5a46e2f901d
static/js/main.e67a4223.js,1712959998732,8283528e361249783f4d15fa47adefd61df489cd8bb21e49572524827988a639
static/js/main.e67a4223.js.LICENSE.txt,1712959998715,78b0dae5eb307890232de04aef13cfa7ffd74f57361a9985c5aa7076bc75ffb8
static/js/main.e67a4223.js.map,1712959998734,c2bfab70ba1815fe5f0c328585557997940688b4769f069b9fde913742acd9b9
static/media/b_bishop.04932f63ef10dcdee115b649286230f5.svg,1712959998714,74eba906eced75c73696b0d46db8f101e19561a66b67da8bafba7cb8a4da730d
static/media/b_king.5b14c13b083205b43351276ad72f5e49.svg,1712959998714,5d4274ad26955248e80d0d7dd06913deaf176c169fdd1023b690a845d056f1de
static/media/b_knight.7930be9e07b51bc0e069b1d77e31261a.svg,1712959998714,de9e8553bb9d81aaa92c6601ea9957b89b01982845e5fed76383a6d74d93a923
static/media/b_pawn.65485e342f98c53d4789db15863d0661.svg,1712959998715,7103307fd13d166cfa3068de1cc40e07b7b9f9880d2c66ab8291eae9d7ce0985
static/media/b_queen.310fe3e250ab4485dee47268e196e8da.svg,1712959998714,83b1264873d2584e8975641a148b9507793968405810695b5f0a34403f6e53f3
static/media/b_rook.11b82bbd54650e60c08608b80aa3b8cc.svg,1712959998714,c0edb3e3ce877b6e429825dabf400707149e662c3559b449783ca49b1a252e17
static/media/knight-chess.2680b11f7b134d826080.webp,1712959998716,7c9c1ba8daa44c15ebd428282b28c745bf018e9fe71b72634b27a0a115cd008a
static/media/w_bishop.aa411d5809c6380713b4312d55aafc53.svg,1712959998715,64e8cb5c144b90d32b4f4248e6572ceb30d9a90c69cfdbbe9efeddfcf22218c4
static/media/w_king.087bee858f22f327e1429943cf321c2f.svg,1712959998715,32a7ca5472215b837162c8a0643d6d978cc6b5b5e721cb3eb430c579fb01d7c6
static/media/w_knight.d47944d2cee4f8c707d1907706c142fa.svg,1712959998714,61d9efa88c7564dd4ca1cbc29a2f89bf21674704ffab34fc289e74461c41262a
static/media/w_pawn.7fbab4ab8e18494ec243350e83c5ef97.svg,1712959998715,6df1b7747162c2cf0afa94b94004141c8fe6de9ef7a71b390aa692f03a3a6db7
static/media/w_queen.e195644e78392b8215dd588b143f05c9.svg,1712959998714,fcf2890d20abaad28143c0c0bfa5355c81fbe54354ead8c59d62f9170094c9b2
static/media/w_rook.9e48b84f189eea24339f8a679e7a664f.svg,1712959998715,87e62147f5b8e8dde7221cd252150df5c2ad9752d01eead6d3d16ca2bf5746db
6 changes: 6 additions & 0 deletions chess/.firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
index.html,1711736638409,315aff722011970b16e8162811a06b356984d3470125de7f9d3c7f35a8e5528d
logo192.png,1711736324658,79e2b749561016bc8af300ea19f48347ceed3cb1a54f48ae456172eca45e08f0
manifest.json,1711736324659,4368aeaf848ae2e048765562c289452f33ad2a175c4b1951ea8bdf2ada0d5b10
robots.txt,1711736324660,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
logo512.png,1711736324659,212b102aa09e51b3b3e06647e81f7801a61333e171f6582e8124379aabccb41d
favicon.ico,1711736324657,f1f5a278586dc5e87cd75981cfb72b4435b20327a8720ea2211bd34094800eb0
5 changes: 5 additions & 0 deletions chess/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "chess-9a6ec"
}
}
16 changes: 16 additions & 0 deletions chess/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
66 changes: 66 additions & 0 deletions chess/src/components/main/home/BugNotifier.js
Original file line number Diff line number Diff line change
@@ -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 = () => (
<ModalOverlay
bg="none"
backdropFilter="auto"
backdropInvert="80%"
backdropBlur="2px"
/>
);

const { isOpen, onOpen, onClose } = useDisclosure();

useEffect(() => {
const checkServerResponse = () => {
onOpen();
};


checkServerResponse();
}, [onOpen]);

return (
<>
<Modal isCentered isOpen={isOpen} onClose={onClose}>
<OverlayOne />
<ModalContent>
<ModalHeader>Uh Oh!</ModalHeader>
<ModalCloseButton />
<ModalBody>
<Text mb={4}>
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!).
</Text>

<Text mb={4}>
This bug does not affect player vs player mode and is currently
being addressed!
</Text>
</ModalBody>
<ModalFooter>
<Button colorScheme="blue" mr={3} onClick={onClose}>
Got it, thanks for the heads up!
</Button>
</ModalFooter>
</ModalContent>
</Modal>
</>
);
}

export default BugNotifier;
3 changes: 3 additions & 0 deletions chess/src/pages/cpu/Cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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);
Expand Down Expand Up @@ -80,6 +82,7 @@ function CpuDispatch() {

return (
<Flex height="100vh" alignItems="center" justifyContent="center">
<BugNotifier/>
<Box width="60%" p={5} shadow="md" borderWidth="1px">
<VStack spacing={4}>
<Text fontSize="xl">Choose Your Difficulty</Text>
Expand Down

0 comments on commit 95cf4da

Please sign in to comment.