-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 86.9 KB
/
.eslintcache
1
[{"D:\\Desktop\\bingo\\bingo-frontend\\src\\App.js":"1","D:\\Desktop\\bingo\\bingo-frontend\\src\\index.js":"2","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard.js":"3","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Lobby.js":"4","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView.js":"5","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\CardView.js":"6","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\Cards.js":"7","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useClassicGameAdmin.js":"8","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\Card.js":"9","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\ListBox.js":"10","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin.js":"11","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\GameDrawer.js":"12","D:\\Desktop\\bingo\\bingo-frontend\\src\\reportWebVitals.js":"13","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\Card.js":"14","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useGameDrawer.js":"15","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\NameDrawerView.js":"16","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\utilityFunctions.js":"17","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\CreateRoom.js":"18","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\PlayerDeckView.js":"19","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\usePlayerLogin.js":"20","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\CardView.js":"21","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckViewLogin.js":"22","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\AddCardDialog.js":"23","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\DeleteCardDialog.js":"24","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\DeletePlayerDialog.js":"25","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\CommonComponents\\DialogScaffold.js":"26","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\GameDrawer\\ResetPickedCellsDialog.js":"27","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView\\SelectCellChipArray.js":"28","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView\\SelectCellDialog.js":"29","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\LandingPage.js":"30","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\GettingStarted.js":"31","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useCreateRoom.js":"32"},{"size":2981,"mtime":1617994273650,"results":"33","hashOfConfig":"34"},{"size":517,"mtime":1616811055374,"results":"35","hashOfConfig":"34"},{"size":6073,"mtime":1616836734616,"results":"36","hashOfConfig":"34"},{"size":3004,"mtime":1616994141809,"results":"37","hashOfConfig":"34"},{"size":5469,"mtime":1617985340344,"results":"38","hashOfConfig":"34"},{"size":2876,"mtime":1617243495332,"results":"39","hashOfConfig":"34"},{"size":922,"mtime":1616811055376,"results":"40","hashOfConfig":"34"},{"size":4868,"mtime":1617179050018,"results":"41","hashOfConfig":"34"},{"size":1546,"mtime":1616811055375,"results":"42","hashOfConfig":"34"},{"size":1132,"mtime":1616811055376,"results":"43","hashOfConfig":"34"},{"size":12210,"mtime":1618119356852,"results":"44","hashOfConfig":"34"},{"size":7323,"mtime":1618022320951,"results":"45","hashOfConfig":"34"},{"size":375,"mtime":1616811055377,"results":"46","hashOfConfig":"34"},{"size":1860,"mtime":1617249200716,"results":"47","hashOfConfig":"34"},{"size":4949,"mtime":1617626557554,"results":"48","hashOfConfig":"34"},{"size":1661,"mtime":1616811055376,"results":"49","hashOfConfig":"34"},{"size":660,"mtime":1616991025153,"results":"50","hashOfConfig":"34"},{"size":1849,"mtime":1616814956214,"results":"51","hashOfConfig":"34"},{"size":5031,"mtime":1621758168492,"results":"52","hashOfConfig":"34"},{"size":4172,"mtime":1618120031669,"results":"53","hashOfConfig":"34"},{"size":2845,"mtime":1616811055376,"results":"54","hashOfConfig":"34"},{"size":3850,"mtime":1618119830112,"results":"55","hashOfConfig":"34"},{"size":2160,"mtime":1617100082388,"results":"56","hashOfConfig":"34"},{"size":2181,"mtime":1618027673938,"results":"57","hashOfConfig":"34"},{"size":782,"mtime":1617100032670,"results":"58","hashOfConfig":"34"},{"size":1447,"mtime":1617633265295,"results":"59","hashOfConfig":"34"},{"size":721,"mtime":1617100217334,"results":"60","hashOfConfig":"34"},{"size":1785,"mtime":1617243373877,"results":"61","hashOfConfig":"34"},{"size":1304,"mtime":1617985281246,"results":"62","hashOfConfig":"34"},{"size":11362,"mtime":1621756873021,"results":"63","hashOfConfig":"34"},{"size":7787,"mtime":1617993805853,"results":"64","hashOfConfig":"34"},{"size":3267,"mtime":1618029139163,"results":"65","hashOfConfig":"34"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"68","usedDeprecatedRules":"69"},"j62p19",{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"75","usedDeprecatedRules":"72"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"78","usedDeprecatedRules":"72"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"81","usedDeprecatedRules":"72"},{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"69"},{"filePath":"86","messages":"87","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"88","usedDeprecatedRules":"69"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"91"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"96","usedDeprecatedRules":"72"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":"99","usedDeprecatedRules":"72"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"102"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"105"},{"filePath":"106","messages":"107","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"108","usedDeprecatedRules":"109"},{"filePath":"110","messages":"111","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"112","usedDeprecatedRules":"69"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"115"},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"122","usedDeprecatedRules":"123"},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"126","messages":"127","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"128","usedDeprecatedRules":"72"},{"filePath":"129","messages":"130","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"131","usedDeprecatedRules":"102"},{"filePath":"132","messages":"133","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"134","usedDeprecatedRules":"72"},{"filePath":"135","messages":"136","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"137","usedDeprecatedRules":"69"},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"123"},{"filePath":"140","messages":"141","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"142","usedDeprecatedRules":"69"},{"filePath":"143","messages":"144","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"145","messages":"146","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"147","usedDeprecatedRules":"109"},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"72"},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\Desktop\\bingo\\bingo-frontend\\src\\App.js",["154","155","156"],"import './App.css';\r\n\r\nimport React, {useState} from 'react';\r\n\r\nimport {\r\n BrowserRouter as Router,\r\n Switch,\r\n Route,\r\n Link,\r\n useRouteMatch,\r\n useParams,\r\n Redirect\r\n} from \"react-router-dom\";\r\n\r\nimport { CookiesProvider } from 'react-cookie';\r\n\r\nimport Dashboard from './pages/Dashboard';\r\nimport CreateRoom from './pages/CreateRoom';\r\nimport Lobby from './pages/Lobby';\r\nimport ClassicAdmin from './pages/Classic/Admin';\r\nimport ClassicDeckView from './pages/Classic/DeckView';\r\nimport ClassicDeckViewLogin from './pages/Classic/DeckViewLogin';\r\nimport ClassicGameDrawer from './pages/Classic/GameDrawer';\r\nimport LandingPage from './pages/LandingPage';\r\nimport GettingStarted from './pages/GettingStarted';\r\n\r\nfunction Home() {\r\n const [roomID, setRoomID] = useState(null) //create custom hook once grew\r\n return (\r\n <>\r\n {roomID === null && <CreateRoom setRoomID={setRoomID}/>}\r\n {roomID !== null && <Dashboard roomID={roomID}/>}\r\n </>\r\n );\r\n}\r\n\r\nfunction AdminRouter(props) {\r\n const {roomId} = props;\r\n const match = useRouteMatch();\r\n return (\r\n <Switch>\r\n <Route path={`${match.path}/game-drawer`}>\r\n <ClassicGameDrawer roomId={roomId} />\r\n </Route>\r\n <Route path={`${match.path}/`}>\r\n <ClassicAdmin roomId={roomId} />\r\n </Route>\r\n </Switch>\r\n )\r\n}\r\n\r\nfunction GameRoom() {\r\n const {roomId} = useParams();\r\n const match = useRouteMatch();\r\n return (\r\n <React.Fragment>\r\n <a href='/' style={{textDecoration: 'none', color: 'rgba(255,255,255,0.3)', padding: '5px', float:'right',}}>BACK TO MAIN</a>\r\n <Switch>\r\n <Route path={`${match.path}/admin`}>\r\n <AdminRouter roomId={roomId}/>\r\n </Route>\r\n <Route path={`${match.path}/:playerId`}>\r\n <ClassicDeckView roomId={roomId} />\r\n </Route>\r\n <Route path={`${match.path}/`}>\r\n <ClassicDeckViewLogin roomId={roomId} />\r\n </Route>\r\n </Switch>\r\n </React.Fragment>\r\n );\r\n}\r\n\r\nfunction ClassicBingo() {\r\n const match = useRouteMatch();\r\n return(\r\n <Switch>\r\n <Route path={`${match.path}/:roomId`}>\r\n <GameRoom/>\r\n </Route>\r\n <Route path='/'>\r\n <Redirect to={{pathname:'/'}}/>\r\n </Route>\r\n </Switch>\r\n )\r\n}\r\n\r\nfunction App() {\r\n return (\r\n <CookiesProvider>\r\n <Router>\r\n <Switch>\r\n <Route path='/classic'>\r\n <ClassicBingo/>\r\n </Route>\r\n <Route path='/upsca'>\r\n <Redirect to={{pathname:'/classic/UPSCA'}}/>\r\n </Route>\r\n <Route path='/UPSCA'>\r\n <Redirect to={{pathname:'/classic/UPSCA'}}/>\r\n </Route>\r\n <Route path='/upsca-admin'>\r\n <Redirect to={{pathname:'/classic/UPSCA/admin'}}/>\r\n </Route>\r\n <Route path=\"/\">\r\n <LandingPage/>\r\n <GettingStarted/>\r\n </Route>\r\n </Switch>\r\n </Router>\r\n </CookiesProvider>\r\n )\r\n}\r\n\r\nexport default App;\r\n",["157","158"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\index.js",[],["159","160"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard.js",["161"],"import React, {useState, useEffect} from 'react'\r\n\r\nimport {Grid, TextField, Button} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles'\r\n\r\nimport ListBox from './Dashboard/ListBox'\r\nimport Cards from './Dashboard/Cards'\r\nimport CardView from './Dashboard/CardView'\r\nimport NameDrawerView from './Dashboard/NameDrawerView'\r\n\r\nconst useStyles = makeStyles((theme)=>({\r\n root: {\r\n margin: theme.spacing(1),\r\n backgroundColor: 'gray',\r\n },\r\n}))\r\n\r\nconst names_static = [\r\n 'Tiffany',\r\n 'Lucille',\r\n 'Thomas',\r\n 'Subhaan',\r\n 'Sydney',\r\n 'Lily',\r\n 'Keeley',\r\n 'Kristi',\r\n 'Izaac',\r\n 'Kayson',\r\n 'Kamile',\r\n 'Alishia',\r\n 'Etienne',\r\n 'Sahar',\r\n 'Daniyal',\r\n 'Pranav',\r\n 'Isla',\r\n 'Komal',\r\n 'Sarina',\r\n 'Aqib'\r\n]\r\n\r\nconst cards_static = [\r\n [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]],\r\n [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]],\r\n [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]],\r\n [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]\r\n]\r\n\r\nconst participant_me = 'Drix'\r\n\r\nfunction Dashboard(props) {\r\n const classes = useStyles();\r\n\r\n const {roomID} = props;\r\n\r\n const [selectedCardIndex, setSelectedCardIndex] = useState('')\r\n const [cardOwners, setCardOwners] = useState({})\r\n const [cardProperties, setCardProperties] = useState({})\r\n const [pickedNames, setPickedNames] = useState([])\r\n const [names, setNames] = useState([])\r\n const [cards, setCards] = useState([])\r\n\r\n //temp\r\n const [newNameVal, setNewNameVal] = useState('')\r\n\r\n const handleSelectCard = (index) => {\r\n setSelectedCardIndex(index)\r\n }\r\n\r\n const handleBack = () => {\r\n setSelectedCardIndex('')\r\n }\r\n\r\n const handleUseCard = (index) => {\r\n const cardOwners_copy = {...cardOwners}\r\n if (!cardOwners_copy[participant_me]) {\r\n cardOwners_copy[participant_me] = [];\r\n };\r\n cardOwners_copy[participant_me].push(index);\r\n setCardOwners(cardOwners_copy);\r\n }\r\n\r\n const handleCancelOwnership = (cardIndex) => {\r\n const cardOwners_copy = {...cardOwners};\r\n const index = cardOwners_copy[participant_me].indexOf(cardIndex)\r\n if (index < 0) {\r\n return;\r\n }\r\n cardOwners_copy[participant_me].splice(index,1)\r\n setCardOwners(cardOwners_copy);\r\n }\r\n\r\n const handleAddName = (e) => {\r\n const names_copy = [...names];\r\n e.preventDefault();\r\n if (names_copy.includes(newNameVal)) {\r\n return;\r\n }\r\n names_copy.push(newNameVal)\r\n \r\n setNewNameVal('')\r\n setNames(names_copy)\r\n }\r\n\r\n\r\n useEffect(()=>{\r\n const cardProps_temp = {};\r\n Object.entries(cardOwners).forEach(([key,val])=>{\r\n val.forEach(item=> {\r\n cardProps_temp[item] = key;\r\n })\r\n });\r\n setCardProperties(cardProps_temp);\r\n //writeData();\r\n }, [cardOwners])\r\n\r\n useEffect(()=>{\r\n //writeData(roomID,'gameData', {names, pickedNames})\r\n }, [names, pickedNames])\r\n\r\n useEffect(()=>{\r\n const numOfCards = 4;\r\n const cards_temp = [];\r\n let pickedNumbers = null;\r\n for (let i = 0; i < numOfCards; i++) {\r\n cards_temp.push([])\r\n pickedNumbers = [];\r\n for (let j = 0; j < 5; j++) {\r\n cards_temp[i].push([])\r\n for (let k = 0; k < 5; k++) {\r\n let randomNum = null;\r\n do {\r\n randomNum = Math.random() * names_static.length;\r\n randomNum = randomNum.toFixed(0);\r\n } while((pickedNumbers.includes(randomNum) || names_static[randomNum] === '' || names_static[randomNum] === null || names_static[randomNum] === undefined) && pickedNumbers.length < names_static.length)\r\n pickedNumbers.push(randomNum)\r\n cards_temp[i][j].push(names_static[randomNum]);\r\n }\r\n }\r\n }\r\n setCards(cards_temp);\r\n },[names])\r\n\r\n return(\r\n <Grid container direction='row' spacing={2} justify='center' className={classes.root}>\r\n <Grid item xs={10} sm={3} md={2}>\r\n <ListBox items={names} listName={`Room ${roomID} Participants`}/>\r\n </Grid>\r\n <Grid item xs={10} sm={3} md={2}>\r\n <ListBox items={names} listName='Items List'/>\r\n </Grid>\r\n <Grid item xs={10} sm={3} md={2}>\r\n <ListBox items={pickedNames} listName='Picked Items'/>\r\n </Grid>\r\n <Grid item xs={12} sm={6} md={8}>\r\n <NameDrawerView names={names} pickedNames={pickedNames} setPickedNames={setPickedNames} />\r\n </Grid>\r\n {selectedCardIndex === '' ? \r\n <Grid item xs={12} sm={6} md={8}>\r\n <Cards items={cards} onSelectCard={handleSelectCard} cardProperties={cardProperties}/>\r\n </Grid>\r\n :\r\n <Grid item xs={12} sm={6} md={8}>\r\n <CardView\r\n items={cards[selectedCardIndex]}\r\n index={selectedCardIndex} \r\n onBack={handleBack} \r\n onUseCard={handleUseCard} \r\n onCancelOwnership={handleCancelOwnership} \r\n cardOwner={cardProperties[selectedCardIndex]}\r\n participant_me={participant_me}\r\n />\r\n </Grid>\r\n }\r\n <Grid item><TextField label='Participant Name' margin='dense'/><Button>Set</Button></Grid>\r\n <Grid item><form onSubmit={handleAddName}><TextField label='New Item' margin='dense' value={newNameVal} onChange={e => {setNewNameVal(e.target.value)}} /><Button onClick={handleAddName} >Set</Button></form></Grid>\r\n </Grid>\r\n )\r\n}\r\n\r\nexport default Dashboard;\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Lobby.js",["162"],"import React from 'react'\r\n\r\nimport {useRouteMatch} from 'react-router-dom';\r\n\r\nimport {Paper, Typography, TextField, Grid, Button} from '@material-ui/core/';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\n\r\nconst useStyles = makeStyles((theme)=>({\r\n root: {\r\n padding: theme.spacing(1),\r\n height: '100%'\r\n },\r\n paperRoot: {\r\n padding: theme.spacing(2)\r\n }\r\n \r\n}))\r\n\r\nfunction Lobby(props) {\r\n const {setRoomID} = props;\r\n const classes = useStyles();\r\n const match = useRouteMatch();\r\n\r\n const handleCreateRoom = () => {\r\n //const roomID = createRoom();\r\n //setRoomID(roomID);\r\n }\r\n\r\n const handleGoToUPSCARoom = () => {\r\n const lobbyUrl = match.path\r\n const upscaRoomUrl = lobbyUrl + 'UPSCA';\r\n window.location.assign(upscaRoomUrl);\r\n }\r\n\r\n const handleGoToRoom = (e) => {\r\n e.preventDefault();\r\n const lobbyUrl = match.path\r\n const roomUrl = lobbyUrl + e.target.roomId.value;\r\n e.target.reset();\r\n window.location.assign(roomUrl);\r\n }\r\n\r\n return(\r\n <Grid container direction='row' justify='center' alignItems='center' className={classes.root}>\r\n <Grid item md={6} sm={10} xs={12}>\r\n <Paper classes={{root: classes.paperRoot}}>\r\n <Grid container direction='column' justify='center' alignItems='center' spacing={2}>\r\n <Grid item>\r\n <Typography variant='h3'>Bingo!</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Grid container direction='column' spacing={1} justify='center' alignItems='center'>\r\n <Grid item>\r\n <Button variant='outlined' onClick={handleGoToUPSCARoom}>Join UPSCA Bingo</Button>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n <Grid item>\r\n <Typography variant={'subtitle1'}>or</Typography>\r\n </Grid>\r\n <Grid item>\r\n <form onSubmit={handleGoToRoom}>\r\n <Grid container direction='column' spacing={1} justify='center' alignItems='center'>\r\n <Grid item>\r\n <TextField variant='outlined' label='Room ID' margin=\"dense\" name='roomId'/>\r\n </Grid>\r\n <Grid item>\r\n <Button variant='outlined' type='submit'>Join Room</Button>\r\n </Grid>\r\n </Grid>\r\n </form>\r\n </Grid>\r\n <Grid item>\r\n <Typography variant={'subtitle1'}>or</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Button variant='outlined' onClick={handleCreateRoom}>Create Room</Button>\r\n </Grid>\r\n </Grid>\r\n </Paper>\r\n </Grid>\r\n </Grid>\r\n )\r\n}\r\n\r\nexport default Lobby;","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView.js",["163","164","165"],"import React, {useEffect, useState} from 'react';\r\nimport {\r\n useParams,\r\n useRouteMatch\r\n } from \"react-router-dom\";\r\n\r\n \r\nimport {Grid, Typography, Button} from '@material-ui/core/';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport {ZoomIn as ZoomInIcon, ZoomOut as ZoomOutIcon} from '@material-ui/icons';\r\n\r\nimport CardView from './CardView'\r\nimport SelectCellDialog from './DeckView/SelectCellDialog';\r\nimport SelectCellChipArray from './DeckView/SelectCellChipArray';\r\n\r\nimport useClassicGameAdmin from '../../util/useClassicGameAdmin';\r\nimport usePlayerLogin from '../../util/usePlayerLogin';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n root: {\r\n marginTop: theme.spacing(2)\r\n },\r\n headers: {\r\n marginLeft: theme.spacing(1),\r\n color: 'white',\r\n textShadow: '0.07em 0.07em #d6a224',\r\n },\r\n clickableTypo: {\r\n textDecoration: 'underline',\r\n cursor: 'pointer',\r\n width: 'fit-content'\r\n },\r\n thinTypo: {\r\n textShadow: '0.05em 0.05em #d6a224',\r\n },\r\n scaleDownDiv: {\r\n transform: 'scale(0.6)',\r\n transformOrigin: '1vw 0',\r\n width: 'fit-content',\r\n marginLeft: 'auto',\r\n marginRight: 'auto'\r\n },\r\n gridItemScaleDown: {\r\n height:'16em',\r\n },\r\n scaleDownDiv2: {\r\n transform: 'scale(0.3)',\r\n transformOrigin: '1vw 0',\r\n width: 'fit-content',\r\n marginLeft: 'auto',\r\n marginRight: 'auto'\r\n },\r\n gridItemScaleDown2: {\r\n height:'8em',\r\n }\r\n}));\r\n\r\nfunction DeckView(props) {\r\n const {roomId} = props;\r\n const match = useRouteMatch();\r\n\r\n const classes = useStyles();\r\n\r\n const {playerId} = useParams();\r\n \r\n const [cards = [], players = [], isLoading, setClassicGameAdmin ] = useClassicGameAdmin();\r\n const [cookies, isLoading2, setPlayerLogin] = usePlayerLogin();\r\n\r\n const [selectCellDialog, setSelectCellDialog] = useState(false);\r\n const [selectedChips, setSelectedChips] = useState([]);\r\n const [zoom, setZoom] = useState('in');\r\n\r\n const handleLogout = () => {\r\n setPlayerLogin('logout');\r\n };\r\n\r\n const handleAddChip = () => {\r\n setSelectCellDialog(true);\r\n };\r\n\r\n const handleAddCellConfirm = (numArr) => {\r\n setSelectedChips(\r\n (currentState) => {\r\n const currentState_ = [...currentState];\r\n numArr.forEach(item=>{\r\n const parsedItem = parseInt(item);\r\n if (!currentState.includes(parsedItem) && !isNaN(parsedItem)) {\r\n currentState_.push(parsedItem);\r\n };\r\n });\r\n return currentState_;\r\n }\r\n );\r\n };\r\n\r\n const handleZoom = () => {\r\n setZoom(\r\n (zoom) => zoom === 'in'? 'out': 'in'\r\n )\r\n }\r\n\r\n useEffect(()=> {\r\n if (cookies.loginToken) {\r\n setClassicGameAdmin('get-player', {playerId, roomId});\r\n } else {\r\n const rootPath = match.path.split('/:roomId/:playerId')[0]\r\n window.location.assign(`${rootPath}/${roomId}`)\r\n };\r\n }, [cookies]);\r\n \r\n return (\r\n <React.Fragment>\r\n <Grid container direction='row' alignItems = 'center' spacing={2} className={classes.root}>\r\n <Grid item className={classes.headers} xs={12} md={9}>\r\n <Typography variant='h6'><b>Welcome {players.name}!</b></Typography>\r\n <Typography variant='subtitle2' className={classes.thinTypo}>Player ID: {players.id}</Typography>\r\n <Typography variant='subtitle2' className={`${classes.clickableTypo} ${classes.thinTypo}`} onClick={handleLogout}>Logout</Typography>\r\n <br/>\r\n <Typography variant='subtitle1' className={classes.thinTypo}>Selected Cells:</Typography>\r\n <SelectCellChipArray chipData={selectedChips} setChipData={setSelectedChips} onAddChip={handleAddChip} />\r\n <br/>\r\n <Button size='small' variant='contained' onClick={handleZoom} startIcon={zoom === 'in'? <ZoomOutIcon/> : <ZoomInIcon/>}>{zoom === 'in'? 'Zoom Out' : 'Zoom In'}</Button>\r\n <br/>\r\n </Grid>\r\n <Grid item xs={12}>\r\n <Grid container direction='row' justify='flext-start' spacing={1}>\r\n {cards.map(item => (\r\n <Grid item \r\n xs={zoom === 'in' ? 6 : 3} \r\n sm={zoom === 'in' ? 4 : 2} \r\n md={zoom === 'in' ? 3 : 2} \r\n lg={zoom === 'in' ? 2 : 1} \r\n xl={1}\r\n key={`${playerId}-card-${item.id}`} \r\n className={zoom === 'in' ? classes.gridItemScaleDown : classes.gridItemScaleDown2}>\r\n <div className={zoom === 'in' ? classes.scaleDownDiv : classes.scaleDownDiv2}>\r\n <CardView items={item.cells} cardId={`${roomId}-${item.id}`} pickedCells={selectedChips} />\r\n </div>\r\n </Grid>\r\n ))}\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n <SelectCellDialog \r\n open={selectCellDialog}\r\n setOpen={setSelectCellDialog}\r\n onConfirm={handleAddCellConfirm}\r\n />\r\n </React.Fragment>\r\n )\r\n }\r\n\r\n export default DeckView;","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\CardView.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\Cards.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useClassicGameAdmin.js",["166"],"import { useState } from \"react\";\r\n\r\nimport { toast } from \"react-toastify\";\r\n\r\nimport { postRequest } from \"./utilityFunctions\";\r\n\r\nimport { useCookies } from 'react-cookie';\r\n\r\nconst displayToast = (message, type, displayDuration) => {\r\n toast(message, {\r\n position: toast.POSITION.TOP_CENTER,\r\n type: type,\r\n autoClose: displayDuration,\r\n });\r\n};\r\n\r\nexport default function useClassicGameAdmin(vars) { // You could use this var to set something on the local state.\r\n let [cookies, setCookie, removeCookie] = useCookies(['loginToken']);\r\n\r\n var timeOutVar;\r\n\r\n //states\r\n const [players, setPlayers] = useState([]);\r\n const [cards, setCards] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n /*************** Dont edit below this line ***************/\r\n function startTimeout() {\r\n timeOutVar = setTimeout(function () {\r\n console.log(\"Server Timeout\");\r\n }, 120000);\r\n }\r\n\r\n function stopTimeout() {\r\n clearTimeout(timeOutVar);\r\n }\r\n\r\n const onRequestSuccess = (req, resData, onSuccess) => {\r\n const { data, oFlag, oMessage } = resData;\r\n if (oFlag) {\r\n onSuccess(data);\r\n } else {\r\n console.log(req, ': ', oMessage);\r\n alert(oMessage);\r\n };\r\n \r\n setIsLoading(false);\r\n displayToast(\r\n oMessage,\r\n oFlag ? toast.TYPE.SUCCESS : toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const onRequestFail = (req, status) => {\r\n if (status === 401) {\r\n removeCookie('loginToken', {path: '/'});\r\n removeCookie('userInfo', {path: '/'});\r\n console.log('Token reset.', cookies)\r\n }\r\n \r\n setIsLoading(false);\r\n alert(status);\r\n console.log(\r\n \"Server Error: Please contact your server administrator.\",\r\n );\r\n \r\n displayToast(\r\n status || 'Server Error',\r\n toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const makePostRequest = (req, api, dataparam, loginToken, onSuccess) => {\r\n postRequest(api, dataparam, loginToken)\r\n .then((res) => {\r\n stopTimeout();\r\n if (res.status !== 200 && res.status !== 201) {\r\n onRequestFail(req, res.status);\r\n } else {\r\n onRequestSuccess(req, res.data, onSuccess); \r\n }\r\n })\r\n .catch((err) => {\r\n stopTimeout();\r\n onRequestFail(req, (err && err.response) ? err.response.status: '');\r\n console.log(\"makePostRequest_err: \", err);\r\n });\r\n };\r\n\r\n /*************** Dont edit above this line ***************/\r\n\r\n const makeRequest = (req, vars = {}, event) => {\r\n var api = \"\";\r\n var dataparam = {};\r\n let onSuccess = () => {};\r\n const { roomId, playerId, noOfCards } = vars;\r\n setIsLoading(true);\r\n startTimeout();\r\n switch (req) {\r\n case \"get-player\":\r\n api += \"get-player\";\r\n dataparam = {playerId, userId: playerId, roomId}; // This are the parameters or arguments supplied on the post request.\r\n onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n setCards(data.cards);\r\n setPlayers(data.player);\r\n }\r\n break;\r\n case \"get-player-all\":\r\n api += \"get-player-all\";\r\n dataparam = {userId: 'admin', roomId};\r\n onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n setPlayers(data.players.reverse());\r\n }\r\n break;\r\n case \"register-player\" :\r\n const {\r\n name, \r\n email, \r\n } = vars;\r\n api += \"register-player\";\r\n dataparam = {name, email, noOfCards, roomId, userId: 'admin'};\r\n onSuccess = (data) => {\r\n makeRequest('get-player-all', {roomId});\r\n event.target.reset();\r\n };\r\n break;\r\n case \"delete-player\" :\r\n api += \"delete-player\";\r\n dataparam = {roomId, userId: 'admin', playerId};\r\n onSuccess = (data) => {\r\n makeRequest('get-player-all', {roomId});\r\n };\r\n break;\r\n case \"delete-card\" :\r\n const {\r\n cardId\r\n } = vars;\r\n api += \"delete-card\";\r\n dataparam = {roomId, userId: 'admin', playerId, cardId};\r\n onSuccess = (data) => {\r\n makeRequest('get-player-all', {roomId});\r\n };\r\n break;\r\n case \"add-card\" :\r\n api += \"add-card\";\r\n dataparam = {roomId, userId: 'admin', playerId, noOfCards};\r\n onSuccess = (data) => {\r\n makeRequest('get-player-all', {roomId});\r\n };\r\n break;\r\n default:\r\n }\r\n if (req !== \"\" || typeof req !== \"undefined\") makePostRequest(req, api, dataparam, cookies.loginToken, onSuccess);\r\n };\r\n\r\n return [\r\n cards,\r\n players,\r\n isLoading,\r\n makeRequest,\r\n ];\r\n}\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\Card.js",[],["167","168"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\ListBox.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin.js",["169","170","171"],"import React, {useEffect, useState} from 'react';\r\n\r\nimport {\r\n Grid, \r\n TextField, \r\n Button, \r\n Paper, \r\n Typography, \r\n Dialog, \r\n DialogContent, \r\n DialogActions,\r\n Backdrop,\r\n CircularProgress\r\n} from '@material-ui/core';\r\nimport {makeStyles, withStyles} from '@material-ui/core/styles'\r\n\r\nimport {useRouteMatch} from 'react-router-dom';\r\n\r\nimport useClassicGameAdmin from '../../util/useClassicGameAdmin';\r\nimport usePlayerLogin from '../../util/usePlayerLogin';\r\nimport PlayerDeckView from './Admin/PlayerDeckView';\r\nimport CardView from './CardView';\r\nimport DeleteCardDialog from './Admin/DeleteCardDialog';\r\nimport DeletePlayerDialog from './Admin/DeletePlayerDialog';\r\nimport AddCardDialog from './Admin/AddCardDialog';\r\n\r\nimport useGameDrawer from '../../util/useGameDrawer';\r\n\r\nconst useStyles = makeStyles((theme)=>({\r\n root: {\r\n padding: theme.spacing(1),\r\n marginTop: theme.spacing(3)\r\n },\r\n paperRoot: {\r\n padding: theme.spacing(2),\r\n textAlign: 'center',\r\n },\r\n deckViewGrid: {\r\n minWidth: '66.7%'\r\n }, \r\n backdrop: {\r\n zIndex: theme.zIndex.drawer + 1,\r\n color: '#fff',\r\n },\r\n h3Typo: {\r\n fontFamily:\"'Manrope', sans-serif\",\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase'\r\n }\r\n}));\r\n\r\nconst CssTextField = withStyles({\r\n root: {\r\n \r\n '& label.Mui-focused': {\r\n color: 'rgba(255,248,6,0.8)',\r\n },\r\n '& label': {\r\n color: 'rgba(255,255,255,0.8)',\r\n },\r\n '&:hover label': {\r\n color: 'rgba(255,248,6,0.8)',\r\n },\r\n '& .MuiOutlinedInput-root': {\r\n color: 'rgba(255,255,255,0.8)',\r\n '& fieldset': {\r\n borderColor: 'rgba(255,255,255,0.4)',\r\n },\r\n '&:hover fieldset': {\r\n borderColor: 'rgba(255,248,6,0.4)',\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: 'rgba(255,248,6,0.8)',\r\n },\r\n },\r\n },\r\n })(TextField);\r\n\r\nfunction ClassicAdmin(props) {\r\n const {roomId} = props;\r\n const classes = useStyles();\r\n const match = useRouteMatch();\r\n\r\n const [cookies, isLoading3, setPlayerLogin] = usePlayerLogin();\r\n const [cards = [], players = [], isLoading, setClassicGameAdmin] = useClassicGameAdmin();\r\n const [pickedCells, isLoading2, setPickedCells] = useGameDrawer();\r\n const [filteredList, setFilteredList] = useState([])\r\n const [selectedCard, setSelectedCard] = useState({});\r\n const [openCardDialog, setOpenCardDialog] = useState(false);\r\n const [enableRefresh, setEnableRefresh] = useState(0); //refresh countdown timer\r\n const [selectedPlayerInfo, setSelectedPlayerInfo] = useState({});\r\n const [confirmDialogControl, setConfirmDialogControl] = useState({\r\n deleteCard: false,\r\n deletePlayer: false,\r\n addCard: false\r\n });\r\n\r\n const handleCreatePlayer = e => {\r\n e.preventDefault();\r\n const {name, email, noOfCards} = e.target;\r\n if (name.value.length < 1 || parseInt(noOfCards.value) < 1) {\r\n alert('Incomplete player details!');\r\n return;\r\n }\r\n setClassicGameAdmin('register-player', {\r\n name: name.value,\r\n email: email.value,\r\n noOfCards: noOfCards.value,\r\n roomId\r\n }, e);\r\n };\r\n\r\n const handleAdminLogin = e => {\r\n e.preventDefault();\r\n const password = e.target.password.value;\r\n setPlayerLogin('login', {roomId, password});\r\n };\r\n\r\n const filterFx = searchTxt => item => {\r\n const {id, name, email} = item.player;\r\n\r\n const itemToString = `${id} ${name} ${email}`;\r\n\r\n return (itemToString.toUpperCase().indexOf(searchTxt.toUpperCase()) >= 0);\r\n }\r\n\r\n const handleSearch = e => {\r\n e.preventDefault();\r\n const searchText = e.target.searchText.value;\r\n if (searchText.length > 0) {\r\n const filtered = players.filter(filterFx(searchText));\r\n setFilteredList(filtered);\r\n } else {\r\n setFilteredList(players);\r\n }\r\n };\r\n\r\n const handleSelectCard = (card) => {\r\n setPickedCells('get-picked-cells', {roomId});\r\n setSelectedCard(card);\r\n setOpenCardDialog(true);\r\n };\r\n\r\n const handleCloseCardDialog = () => {\r\n setOpenCardDialog(false);\r\n setSelectedCard({});\r\n };\r\n\r\n const handleGoToGameDrawer = () => {\r\n let gameDrawerUrl = match.url\r\n\r\n if (gameDrawerUrl[gameDrawerUrl.length - 1] === '/' ||\r\n gameDrawerUrl[gameDrawerUrl.length - 1] === '\\\\') {\r\n gameDrawerUrl += 'game-drawer';\r\n } else {\r\n gameDrawerUrl += '/game-drawer';\r\n }\r\n window.open(gameDrawerUrl);\r\n };\r\n\r\n const handleClickRefresh = () => {\r\n let refreshTime = 10;\r\n setEnableRefresh(refreshTime);\r\n const intervalRef = setInterval(() => {\r\n refreshTime--;\r\n setEnableRefresh(refreshTime);\r\n }, 1000);\r\n \r\n setTimeout(() => {\r\n clearInterval(intervalRef);\r\n }, 10000);\r\n setPickedCells('reset-picked-cells-cache');\r\n setPickedCells('get-picked-cells', {roomId});\r\n };\r\n\r\n const handleToggleConfirmDlg = (key) => (id, name) => {\r\n const confirmDialogControl_ = {...confirmDialogControl};\r\n confirmDialogControl_[key] = !confirmDialogControl_[key];\r\n setConfirmDialogControl(confirmDialogControl_);\r\n if (id) {\r\n setSelectedPlayerInfo({\r\n id, \r\n name\r\n });\r\n };\r\n };\r\n\r\n const handleAddCardConfirm = (playerId, noOfCards) => {\r\n setClassicGameAdmin('add-card', {roomId, playerId, noOfCards});\r\n };\r\n\r\n const handleDeleteCardConfirm = (playerId, cardId) => {\r\n setClassicGameAdmin('delete-card', {roomId, playerId, cardId});\r\n };\r\n\r\n const handleDeletePlayerConfirm = (playerId) => {\r\n setClassicGameAdmin('delete-player', {roomId, playerId});\r\n };\r\n\r\n const handleLogout = () => {\r\n setPlayerLogin('logout');\r\n window.location.reload();\r\n }\r\n\r\n useEffect(() => {\r\n if (cookies.loginToken && cookies.userInfo) {\r\n setClassicGameAdmin(\"get-player-all\", { roomId });\r\n }\r\n }, [cookies]);\r\n \r\n useEffect(() => {\r\n setFilteredList(players);\r\n }, [players]);\r\n\r\n useEffect(()=> {\r\n document.title = 'BINGO! Admin';\r\n if (cookies.userInfo && cookies.userInfo.userId === 'admin'){\r\n setPickedCells('get-picked-cells', {roomId});\r\n };\r\n }, [])\r\n\r\n return (\r\n <Grid container direction='column' justify='center' alignItems='center' spacing={2} className={classes.root}>\r\n <Grid item md={6} sm={10} xs={12}>\r\n <Paper classes={{root: classes.paperRoot}}>\r\n <Grid container direction='column' justify='center' alignItems='center' spacing={2}>\r\n <Grid item>\r\n <Typography variant='h3' className={classes.h3Typo}>Room {roomId} Game Master</Typography>\r\n </Grid>\r\n {!cookies.loginToken ? \r\n <Grid item>\r\n <form onSubmit={handleAdminLogin}>\r\n <Grid container direction='row' spacing={1} justify='center' alignItems='center'>\r\n <Grid item md={6} sm={12}>\r\n <TextField variant='outlined' label='Password' name='password' type='password' margin=\"dense\" fullWidth/>\r\n </Grid>\r\n <Grid item md={2} sm={12}>\r\n <Button variant='contained' type='submit' fullWidth disabled={isLoading3}>Login</Button>\r\n </Grid>\r\n </Grid>\r\n </form>\r\n </Grid>\r\n :\r\n <React.Fragment>\r\n <Grid item>\r\n <form onSubmit={handleCreatePlayer}>\r\n <Grid container direction='row' spacing={1} justify='center' alignItems='center'>\r\n <Grid item md={3} sm={12}>\r\n <TextField variant='outlined' label='Name' name='name' margin=\"dense\" fullWidth required/>\r\n </Grid>\r\n <Grid item md={4} sm={12}>\r\n <TextField variant='outlined' label='Email' name='email' margin=\"dense\" fullWidth/>\r\n </Grid>\r\n <Grid item md={3} sm={12}>\r\n <TextField variant='outlined' label='No of Cards' name='noOfCards' margin=\"dense\" fullWidth required/>\r\n </Grid>\r\n <Grid item md={2} sm={12}>\r\n <Button variant='contained' type='submit' fullWidth>Create Player</Button>\r\n </Grid>\r\n </Grid>\r\n </form>\r\n </Grid>\r\n <Grid item>\r\n <Button variant='contained' onClick={handleGoToGameDrawer} >Game Draw</Button>\r\n </Grid>\r\n <Grid item>\r\n <Button color='secondary' onClick={handleLogout} >Logout</Button>\r\n </Grid>\r\n </React.Fragment>\r\n }\r\n </Grid>\r\n </Paper>\r\n </Grid>\r\n <Grid item xs={12}>\r\n <form onSubmit={handleSearch}>\r\n <Grid container direction='row' spacing={1} alignItems='center'> \r\n <Grid item>\r\n <CssTextField\r\n label=\"Search Player\"\r\n variant=\"outlined\"\r\n size='small'\r\n id=\"custom-css-outlined-input\"\r\n name='searchText'\r\n />\r\n </Grid>\r\n <Grid item>\r\n <Button type='submit' variant='contained' fullWidth>Search</Button>\r\n </Grid>\r\n </Grid> \r\n </form>\r\n </Grid>\r\n {filteredList.map(item => (\r\n <Grid item md={8} sm={12} xs={12} key={`${item.player.id}-deck-view`} className={classes.deckViewGrid} >\r\n <PlayerDeckView \r\n items={item.cards} \r\n playerInfo={item.player} \r\n onSelectCard={handleSelectCard}\r\n onDeleteCard={handleToggleConfirmDlg('deleteCard')}\r\n onDeletePlayer={handleToggleConfirmDlg('deletePlayer')}\r\n onAddCard={handleToggleConfirmDlg('addCard')}\r\n roomId={roomId}\r\n />\r\n </Grid>\r\n ))}\r\n <Dialog open={openCardDialog} onClose={handleCloseCardDialog}>\r\n <DialogContent>\r\n <CardView items={selectedCard.cells} cardId={`${roomId}-${selectedCard.id}`} pickedCells={pickedCells} />\r\n </DialogContent>\r\n <DialogActions>\r\n <Button onClick={handleCloseCardDialog}>Close</Button>\r\n <Button variant='contained' onClick={handleClickRefresh} disabled={enableRefresh > 0}>Refresh {enableRefresh > 0 && `(${enableRefresh})`}</Button>\r\n </DialogActions>\r\n </Dialog>\r\n <DeletePlayerDialog \r\n open={confirmDialogControl.deletePlayer} \r\n setOpen={handleToggleConfirmDlg('deletePlayer')}\r\n onConfirm={handleDeletePlayerConfirm}\r\n playerId={selectedPlayerInfo.id}\r\n playerName={selectedPlayerInfo.name}\r\n />\r\n <DeleteCardDialog \r\n open={confirmDialogControl.deleteCard} \r\n setOpen={handleToggleConfirmDlg('deleteCard')}\r\n onConfirm={handleDeleteCardConfirm}\r\n playerId={selectedPlayerInfo.id}\r\n playerName={selectedPlayerInfo.name}\r\n />\r\n <AddCardDialog \r\n open={confirmDialogControl.addCard} \r\n setOpen={handleToggleConfirmDlg('addCard')}\r\n onConfirm={handleAddCardConfirm}\r\n playerId={selectedPlayerInfo.id}\r\n playerName={selectedPlayerInfo.name}\r\n />\r\n <Backdrop className={classes.backdrop} open={isLoading || isLoading2 || isLoading3}>\r\n <CircularProgress color=\"inherit\" />\r\n </Backdrop>\r\n </Grid>\r\n )\r\n }\r\n\r\n export default ClassicAdmin;","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\GameDrawer.js",["172","173","174","175","176","177","178","179","180"],"import React, {useEffect, useState, useRef} from 'react';\r\n\r\nimport {\r\n Grid, \r\n Button,\r\n Typography, \r\n Paper, \r\n IconButton, \r\n Backdrop, \r\n Tooltip\r\n} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\nimport {RotateLeft as RotateLeftIcon} from '@material-ui/icons';\r\nimport Image from 'material-ui-image';\r\n\r\nimport useGameDrawer from '../../util/useGameDrawer';\r\nimport ResetPickedCellsDialog from './GameDrawer/ResetPickedCellsDialog'\r\n\r\nconst bingo = {\r\n B: [1,15],\r\n I: [16, 30],\r\n N: [31,45],\r\n G: [46,60],\r\n O: [61,75],\r\n}\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n gridRoot: {\r\n minHeight: '105%'\r\n },\r\n roundPaper: {\r\n width: '80px',\r\n height: '80px',\r\n borderRadius: '100%',\r\n },\r\n centeredTypography: {\r\n textAlign: 'center',\r\n paddingTop: '25px'\r\n },\r\n h1Typography: {\r\n fontSize: '15em',\r\n color: 'white',\r\n textShadow: '4px 3px #d6a224',\r\n fontFamily: \"'Bangers', cursive\"\r\n },\r\n h5Typography: {\r\n color: 'white',\r\n textShadow: '2px 2px 4px #000000',\r\n paddingTop: theme.spacing(3)\r\n },\r\n backdrop: {\r\n zIndex: theme.zIndex.drawer + 1,\r\n color: '#fff',\r\n },\r\n img: {\r\n width: '20em',\r\n height: 'auto'\r\n },\r\n credits: {\r\n fontSize: '0.5em',\r\n color: 'rgba(255,255,255,0.2)'\r\n },\r\n ballTypo: {\r\n fontFamily: \"'Bangers', cursive\"\r\n }\r\n}));\r\n\r\nconst GameDrawer = props => {\r\n const {roomId} = props;\r\n const classes = useStyles();\r\n\r\n const [pickedCells, isLoading, setPickedCells] = useGameDrawer();\r\n const [letter, setLetter] = useState('');\r\n const [number, setNumber] = useState(0);\r\n const [intervalId, setIntervalId] = useState(NaN);\r\n const [isWaiting, setIsWaiting] = useState(false);\r\n const [pickedCellsForDisplay, setPickedCellsForDisplay] = useState([]);\r\n const [resetDialog, setResetDialog] = useState(false);\r\n \r\n const audio = useRef(new Audio('/bngsnd.mp3'));\r\n\r\n const getLetter = number_ => {\r\n if (number_ < 1) {\r\n return('');\r\n }\r\n switch (true) {\r\n case (number_ < 16):\r\n return('B')\r\n break;\r\n case (number_ < 31):\r\n return('I')\r\n break;\r\n case (number_ < 46):\r\n return('N')\r\n break;\r\n case (number_ < 61):\r\n return('G')\r\n break;\r\n case (number_ <= 75):\r\n return('O')\r\n break;\r\n default:\r\n return('')\r\n break;\r\n };\r\n };\r\n\r\n const handleDrawNumber = () => {\r\n setPickedCells('pick-cell', {roomId});\r\n audio.current.play();\r\n const rangeStart = 1;\r\n const rangeEnd = 75;\r\n\r\n setIsWaiting(true);\r\n const intervalId_ = setInterval(() => {\r\n const randomFloat = Math.random();\r\n setNumber(Math.floor(randomFloat * (rangeEnd - rangeStart)) + rangeStart);\r\n }, 50);\r\n setIntervalId(intervalId_);\r\n };\r\n\r\n const handleReset = () => {\r\n setResetDialog(true);\r\n };\r\n\r\n const handleConfirmReset = () => {\r\n setPickedCells('reset-picked-cells', {roomId});\r\n };\r\n\r\n useEffect(()=> {\r\n if (!isNaN(intervalId)) {\r\n setTimeout(() => {\r\n clearInterval(intervalId);\r\n setNumber(pickedCells[pickedCells.length - 1]);\r\n setIsWaiting(false);\r\n \r\n audio.current.pause();\r\n audio.current.currentTime = 0;\r\n\r\n const pickedCells_ = [...pickedCells];\r\n pickedCells_.reverse();\r\n setPickedCellsForDisplay(pickedCells_);\r\n }, 2000);\r\n } else {\r\n const pickedCells_ = [...pickedCells];\r\n pickedCells_.reverse();\r\n setPickedCellsForDisplay(pickedCells_);\r\n }\r\n }, [pickedCells]);\r\n\r\n useEffect(()=>{\r\n if (number && number > 0) {\r\n const letter_ = getLetter(number);\r\n setLetter(letter_);\r\n } else {\r\n setLetter('');\r\n };\r\n }, [number]);\r\n \r\n useEffect(()=> {\r\n setPickedCells('get-picked-cells', {roomId});\r\n document.title = 'BINGO! Picker';\r\n }, []);\r\n\r\n return(\r\n <Grid container direction='column' alignItems='center' spacing={4} className={classes.gridRoot}>\r\n <Grid item>\r\n <Typography variant='h5' className={classes.h5Typography}>\r\n Classic Bingo - Room {roomId}\r\n </Typography>\r\n </Grid>\r\n <Grid item>\r\n <Typography variant='h1' className={classes.h1Typography}>\r\n {letter} {number > 0 && number}\r\n </Typography>\r\n </Grid>\r\n <Grid item>\r\n <Button \r\n variant='outlined' \r\n onClick={handleDrawNumber} \r\n disabled={isWaiting || pickedCells.length === 75} \r\n >\r\n {pickedCells.length === 75 ? 'All numbers picked.' : 'Draw Number'}\r\n </Button>\r\n <Tooltip title='Reset Draw' aria-label='reset draw'>\r\n <IconButton aria-label=\"delete\" className={classes.margin} onClick={handleReset}>\r\n <RotateLeftIcon fontSize=\"small\" />\r\n </IconButton>\r\n </Tooltip>\r\n </Grid>\r\n <Grid item>\r\n <Grid container direction='row' spacing={2} justify='flex-start'>\r\n {pickedCellsForDisplay.map(item=> {\r\n const letter_ = getLetter(item);\r\n return (\r\n <Grid item key={`${item}-ball-grid`}>\r\n <Paper elevation={3} className={classes.roundPaper}>\r\n <Typography variant='h5' className={`${classes.centeredTypography} ${classes.ballTypo}`}>{letter_} {item}</Typography>\r\n </Paper>\r\n </Grid>\r\n );\r\n })}\r\n </Grid>\r\n </Grid>\r\n <ResetPickedCellsDialog open={resetDialog} setOpen={setResetDialog} onConfirm={handleConfirmReset}/>\r\n <Backdrop className={classes.backdrop} open={isWaiting || isLoading}>\r\n <Grid container direction='column' alignItems='center'>\r\n <Grid item>\r\n <div className={classes.img}>\r\n <Image\r\n src={roomId === 'UPSCA'? '/raffle-loading.gif': '/raffle-loading-generic.gif'}\r\n style={{\r\n opacity: 1\r\n }}\r\n />\r\n </div></Grid><Grid item>\r\n <Typography variant='subtitle2' className={classes.credits}>“Sound effects obtained from https://www.zapsplat.com“</Typography>\r\n </Grid></Grid>\r\n </Backdrop>\r\n </Grid>\r\n );\r\n};\r\n\r\nexport default GameDrawer;","D:\\Desktop\\bingo\\bingo-frontend\\src\\reportWebVitals.js",[],["181","182"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\Card.js",[],["183","184"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useGameDrawer.js",["185","186"],"import { useState, useEffect } from \"react\";\r\n\r\nimport { toast } from \"react-toastify\";\r\n\r\nimport { postRequest } from \"./utilityFunctions\";\r\n\r\nimport { useCookies } from 'react-cookie';\r\n\r\nconst displayToast = (message, type, displayDuration) => {\r\n toast(message, {\r\n position: toast.POSITION.TOP_CENTER,\r\n type: type,\r\n autoClose: displayDuration,\r\n });\r\n};\r\n\r\nexport default function useGameDrawer(vars) { // You could use this var to set something on the local state.\r\n let [cookies, setCookie, removeCookie] = useCookies(['loginToken']);\r\n\r\n var timeOutVar;\r\n\r\n //states\r\n const [pickedCells, setPickedCells] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n useEffect(()=>{\r\n return window.localStorage.removeItem('pickedCells');\r\n }, [])\r\n\r\n /*************** Dont edit below this line ***************/\r\n function startTimeout() {\r\n timeOutVar = setTimeout(function () {\r\n console.log(\"Server Timeout\");\r\n }, 120000);\r\n }\r\n\r\n function stopTimeout() {\r\n clearTimeout(timeOutVar);\r\n }\r\n\r\n const onRequestSuccess = (req, resData, onSuccess) => {\r\n const { data, oFlag, oMessage } = resData;\r\n if (oFlag) {\r\n onSuccess(data);\r\n } else {\r\n console.log(req, ': ', oMessage);\r\n };\r\n \r\n displayToast(\r\n oMessage,\r\n oFlag ? toast.TYPE.SUCCESS : toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const onRequestFail = (req, status) => {\r\n if (status === 401 || status === 403) {\r\n removeCookie('loginToken', {path: '/'});\r\n removeCookie('userInfo', {path: '/'});\r\n console.log('Token reset.', cookies)\r\n window.location.assign(window.location.href.substring(0,window.location.href.length - 11))\r\n }\r\n\r\n console.log(\r\n \"Server Error: Please contact your server administrator.\",\r\n );\r\n\r\n alert(status || 'Server Error. Please reload the page.');\r\n \r\n displayToast(\r\n status || 'Server Error',\r\n toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const makePostRequest = (req, api, dataparam, loginToken, onSuccess) => {\r\n postRequest(api, dataparam, loginToken)\r\n .then((res) => {\r\n stopTimeout();\r\n setIsLoading(false);\r\n if (res.status !== 200 && res.status !== 201) {\r\n onRequestFail(req, res.status);\r\n } else {\r\n onRequestSuccess(req, res.data, onSuccess); \r\n }\r\n })\r\n .catch((err) => {\r\n stopTimeout();\r\n setIsLoading(false);\r\n onRequestFail(req, (err && err.response) ? err.response.status: '');\r\n console.log(\"makePostRequest_err: \", err);\r\n });\r\n };\r\n\r\n /*************** Dont edit above this line ***************/\r\n\r\n const makeRequest = (req, vars = {}) => {\r\n var api = \"\";\r\n var dataparam = {};\r\n let onSuccess = () => {};\r\n const { roomId } = vars;\r\n setIsLoading(true);\r\n startTimeout();\r\n switch (req) {\r\n case \"get-picked-cells\":\r\n const pickedCells_local = window.localStorage.getItem('pickedCells');\r\n if (pickedCells_local) {\r\n setPickedCells(JSON.parse(pickedCells_local));\r\n setIsLoading(false);\r\n return;\r\n }\r\n api += \"get-picked-cells\";\r\n dataparam = {userId: 'admin', roomId}; // This are the parameters or arguments supplied on the post request.\r\n onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n setPickedCells(data.pickedCells);\r\n \r\n window.localStorage.setItem('pickedCells', JSON.stringify(data.pickedCells))\r\n }\r\n break;\r\n case \"reset-picked-cells-cache\":\r\n window.localStorage.removeItem('pickedCells');\r\n setIsLoading(false);\r\n return;\r\n break;\r\n case \"reset-picked-cells\":\r\n api += \"reset-picked-cells\";\r\n dataparam = {userId: 'admin', roomId};\r\n onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n setPickedCells([]); //It would be better to get picked cells data from backend but leaning on lessening server requests\r\n window.localStorage.removeItem('pickedCells')\r\n }\r\n break;\r\n case \"pick-cell\":\r\n api += \"pick-cell\";\r\n dataparam = {userId: 'admin', roomId};\r\n onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n setPickedCells(data.pickedCells);\r\n \r\n window.localStorage.setItem('pickedCells', JSON.stringify(data.pickedCells))\r\n }\r\n break;\r\n default:\r\n }\r\n if (req !== \"\" || typeof req !== \"undefined\") makePostRequest(req, api, dataparam, cookies.loginToken, onSuccess);\r\n };\r\n\r\n return [\r\n pickedCells,\r\n isLoading,\r\n makeRequest,\r\n ];\r\n}\r\n",["187","188"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\NameDrawerView.js",["189","190","191","192"],"import React, {useState} from 'react'\r\n\r\nimport {Grid, List, ListItem, ListItemText, Typography, Button} from '@material-ui/core/';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\n\r\nconst useStyles = makeStyles((theme)=>({\r\n root: {\r\n minHeight: '100%'\r\n },\r\n list: {\r\n maxHeight: '100%'\r\n }\r\n}))\r\n\r\nconst filterFunc = (pickedNames) => (val) => {\r\n return (!pickedNames.includes(val))\r\n}\r\n\r\nfunction NameDrawerView(props) {\r\n const {ariaLabel = 'picked list', names = [], pickedNames = [], setPickedNames} = props;\r\n const [disabled, setDisabled] = useState(false);\r\n const classes = useStyles();\r\n\r\n const [pickedName, setPickedName] = useState('')\r\n\r\n const draw = () => {\r\n const pickedNames_copy = [...pickedNames]\r\n const pool = names.filter(filterFunc(pickedNames))\r\n const random_index = Math.floor(Math.random() * pool.length)\r\n\r\n console.log(pool[random_index])\r\n if (random_index >= pool.length) {\r\n setDisabled(true)\r\n return;\r\n }\r\n\r\n pickedNames_copy.unshift(pool[random_index])\r\n\r\n setPickedName(pool[random_index])\r\n setPickedNames(pickedNames_copy)\r\n }\r\n\r\n return(\r\n <Grid container direction='column' justify='flex-start' className={classes.root}>\r\n <Grid item>\r\n <Typography variant='h4'>{pickedName || 'BINGO Picker'}</Typography>\r\n </Grid>\r\n <Grid item>\r\n <Button variant='contained' disabled={disabled} onClick={()=>draw()} >Draw a Name</Button>\r\n </Grid>\r\n </Grid>\r\n )\r\n}\r\n\r\nexport default NameDrawerView;","D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\utilityFunctions.js",[],["193","194"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\CreateRoom.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\PlayerDeckView.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\usePlayerLogin.js",["195"],"import { useState, useRef } from \"react\";\r\n\r\nimport { toast } from \"react-toastify\";\r\n\r\nimport { useCookies } from 'react-cookie';\r\n\r\nimport { postRequest } from \"./utilityFunctions\";\r\n\r\nconst displayToast = (message, type, displayDuration) => {\r\n toast(message, {\r\n position: toast.POSITION.TOP_CENTER,\r\n type: type,\r\n autoClose: displayDuration,\r\n });\r\n};\r\n\r\nexport default function useClassicGameAdmin(vars) { // You could use this var to set something on the local state.\r\n\r\n const timeOutVar = useRef(null);\r\n\r\n //states\r\n \r\n const [cookies, setCookie, removeCookie] = useCookies(['loginToken', 'userInfo']);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n /*************** Dont edit below this line ***************/\r\n function startTimeout() {\r\n timeOutVar.current = setTimeout(function () {\r\n console.log(\"Server Timeout\");\r\n }, 120000);\r\n }\r\n\r\n function stopTimeout() {\r\n clearTimeout(timeOutVar.current);\r\n }\r\n\r\n const onRequestSuccess = (req, resData, onSuccess) => {\r\n const { data, oFlag, oMessage } = resData;\r\n if (oFlag) {\r\n onSuccess(data);\r\n } else {\r\n alert(oMessage);\r\n console.log(req, ': ', oMessage);\r\n };\r\n \r\n displayToast(\r\n oMessage,\r\n oFlag ? toast.TYPE.SUCCESS : toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const onRequestFail = (req, status) => {\r\n console.log(\r\n \"Server Error: Please contact your server administrator.\",\r\n );\r\n alert(status);\r\n displayToast(\r\n status || 'Server Error',\r\n toast.TYPE.ERROR,\r\n 2500\r\n );\r\n };\r\n\r\n const makePostRequest = (req, api, dataparam, loginToken, onSuccess) => {\r\n postRequest(api, dataparam, loginToken)\r\n .then((res) => {\r\n stopTimeout();\r\n setIsLoading(false);\r\n if (res.status !== 200 && res.status !== 201) {\r\n onRequestFail(req, res.status);\r\n } else {\r\n onRequestSuccess(req, res.data, onSuccess); \r\n }\r\n })\r\n .catch((err) => {\r\n stopTimeout();\r\n setIsLoading(false);\r\n onRequestFail(req,'Login Failed');\r\n console.log(\"makePostRequest_err: \", err);\r\n });\r\n };\r\n\r\n /*************** Dont edit above this line ***************/\r\n\r\n const makeRequest = (req, vars = {}) => {\r\n var api = \"\";\r\n var dataparam = {};\r\n let onSuccess = () => {};\r\n\r\n const {\r\n roomId = '',\r\n playerId = '',\r\n password\r\n } = vars;\r\n\r\n startTimeout();\r\n setIsLoading(true);\r\n switch (req) {\r\n // case \"get-player\":\r\n // const {playerId} = vars;\r\n // api = \"get-player\";\r\n // dataparam = {playerId}; // This are the parameters or arguments supplied on the post request.\r\n // onSuccess = (data) => { // This is a callback that executes at post request success. i.e. data is the res.data returned by the server\r\n \r\n // }\r\n // break;\r\n case \"login\" :\r\n api = \"login\";\r\n dataparam = {roomId, password};\r\n onSuccess = (data) => {\r\n const {loginToken} = data;\r\n const maxAge = 24 * 60 * 60;\r\n \r\n setCookie('loginToken', loginToken, { path: '/', maxAge });\r\n setCookie('userInfo', {roomId, userId: 'admin'}, { path: '/', maxAge });\r\n };\r\n break;\r\n case \"player-login\" :\r\n api = \"player-login\";\r\n dataparam = {roomId, userId : playerId};\r\n onSuccess = (data) => {\r\n const {loginToken, roomId, userId} = data;\r\n const maxAge = 7 * 24 * 60 * 60;\r\n \r\n setCookie('loginToken', loginToken, { path: '/', maxAge });\r\n setCookie('userInfo', {roomId, userId}, { path: '/', maxAge });\r\n };\r\n break;\r\n case \"logout\" :\r\n removeCookie('loginToken', {path: '/'});\r\n removeCookie('userInfo', {path: '/'});\r\n setIsLoading(false);\r\n return;\r\n break;\r\n default:\r\n }\r\n if (req !== \"\" || typeof req !== \"undefined\") makePostRequest(req, api, dataparam, '', onSuccess);\r\n };\r\n\r\n return [\r\n cookies,\r\n isLoading,\r\n makeRequest,\r\n ];\r\n}\r\n",["196","197"],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Dashboard\\CardView.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckViewLogin.js",["198","199","200"],"import React, {useEffect} from 'react';\r\n\r\nimport {Grid, TextField, Button, Paper, Typography} from '@material-ui/core';\r\nimport {makeStyles, withStyles} from '@material-ui/core/styles';\r\n\r\nimport {useRouteMatch} from 'react-router-dom';\r\n\r\nimport usePlayerLogin from '../../util/usePlayerLogin';\r\n\r\nconst useStyles = makeStyles((theme)=>({\r\n root: {\r\n padding: theme.spacing(1),\r\n marginTop: theme.spacing(3),\r\n '& h3': {\r\n fontFamily:\"'Manrope', sans-serif\",\r\n fontWeight: 'bold',\r\n textTransform: 'uppercase'\r\n }\r\n },\r\n paperRoot: {\r\n padding: theme.spacing(2),\r\n textAlign: 'center'\r\n },\r\n}));\r\n\r\nfunction DeckViewLogin(props) {\r\n const {roomId} = props;\r\n const match = useRouteMatch();\r\n\r\n const classes = useStyles();\r\n\r\n const [cookies, isLoading, setPlayerLogin] = usePlayerLogin();\r\n\r\n const handleAdminLogin = e => {\r\n e.preventDefault();\r\n const playerId = e.target.playerId.value;\r\n setPlayerLogin('player-login', {roomId, playerId});\r\n }\r\n\r\n useEffect(() => {\r\n if (cookies.loginToken && cookies.userInfo) {\r\n const cui = cookies.userInfo;\r\n if (cui.roomId === undefined) {\r\n return;\r\n }\r\n if (cui.roomId !== roomId) {\r\n alert(`You are logged out from room ${cui.roomId} since you entered a different room.`)\r\n setPlayerLogin('logout');\r\n return;\r\n } else if (match.path) {\r\n const rootPath = match.path.split('/:roomId/')[0];\r\n window.location.assign(`${rootPath}/${roomId}/${cui.userId}`);\r\n };\r\n }\r\n }, [cookies]);\r\n\r\n // Temporary for UPSCA purpose\r\n useEffect(()=>{\r\n if (roomId === 'upsca') {\r\n const rootPath = match.path.split('/:roomId/')[0]\r\n window.location.assign(`${rootPath}/UPSCA`)\r\n }\r\n if (match.url[match.url.length - 1] === '/') {\r\n window.location.assign(match.url.substring(0,match.url.length - 1))\r\n }\r\n }, []);\r\n\r\n return (\r\n <Grid container direction='column' justify='center' alignItems='center' spacing={2} className={classes.root}>\r\n <Grid item md={6} sm={10} xs={12}>\r\n <Paper classes={{root: classes.paperRoot}}>\r\n <Grid container direction='column' justify='center' alignItems='center' spacing={2}>\r\n <Grid item>\r\n <Typography variant='h3'>Room {roomId} Player Login</Typography>\r\n </Grid>\r\n <Grid item>\r\n <form onSubmit={handleAdminLogin}>\r\n <Grid container direction='row' spacing={1} justify='center' alignItems='center'>\r\n <Grid item md={6} xs={12}>\r\n <TextField variant='outlined' label='Player ID' name='playerId' margin=\"dense\" fullWidth/>\r\n </Grid>\r\n <Grid item md={3} xs={12}>\r\n <Button variant='contained' type='submit' fullWidth disabled={isLoading}>Login</Button>\r\n </Grid>\r\n <Grid item md={12} xs={12}></Grid>\r\n <Grid item md={10} xs={10}><Typography variant='subtitle2'>For Room Admin:</Typography></Grid>\r\n <Grid item md={4} xs={12}>\r\n <Button variant='outlined' type='submit' fullWidth href={`${match.url}/admin`} size='small'>Go to Admin Login</Button>\r\n </Grid>\r\n </Grid>\r\n </form>\r\n </Grid>\r\n </Grid>\r\n </Paper>\r\n </Grid>\r\n </Grid>\r\n )\r\n }\r\n\r\n export default DeckViewLogin;","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\AddCardDialog.js",["201"],"import React, {useState} from 'react';\r\nimport {TextField} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\n\r\nimport DialogScaffold from '../CommonComponents/DialogScaffold'\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n\r\n}));\r\n\r\nconst FieldsGrid = (props) => {\r\n const {setNoOfCards, noOfCards, confirmFinal} = props;\r\n return(\r\n <React.Fragment>\r\n {\r\n !confirmFinal &&\r\n <TextField\r\n autoFocus\r\n fullWidth\r\n label='No. of cards'\r\n margin='dense'\r\n value={noOfCards}\r\n onChange={e=>setNoOfCards(e.target.value)}\r\n />\r\n }\r\n </React.Fragment>);\r\n};\r\n\r\nconst AddCardDialog = (props) => {\r\n const {open, setOpen, onConfirm, playerId, playerName} = props;\r\n const classes = useStyles();\r\n\r\n const [confirmFinal, setConfirmFinal] = useState(false);\r\n const [noOfCards, setNoOfCards] = useState('');\r\n\r\n const handleOpen = () => {\r\n setConfirmFinal(false);\r\n setOpen();\r\n };\r\n\r\n const handleConfirm = () => {\r\n if (confirmFinal) {\r\n onConfirm(playerId, noOfCards);\r\n setOpen();\r\n setNoOfCards('');\r\n setConfirmFinal(false);\r\n } else if (noOfCards.length > 0) {\r\n setConfirmFinal(true);\r\n };\r\n };\r\n\r\n const handleCancel = ()=>{\r\n setNoOfCards('');\r\n };\r\n\r\n return (\r\n <DialogScaffold\r\n open={open}\r\n setOpen={handleOpen}\r\n onConfirm={handleConfirm}\r\n onCancel={handleCancel}\r\n title='Add Cards'\r\n contentText={`${confirmFinal ? \r\n `Are you sure to add ${noOfCards} cards to player ${playerId} ${playerName}'s deck?` :\r\n `Specify how many cards you want to add.`\r\n }`}\r\n FieldsGrid={<FieldsGrid \r\n noOfCards={noOfCards} \r\n setNoOfCards={setNoOfCards} \r\n confirmFinal={confirmFinal}\r\n />\r\n }\r\n confirmText={`${confirmFinal ? 'Confirm': 'Done'}`}\r\n />\r\n );\r\n};\r\n\r\nexport default AddCardDialog;\r\n\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\DeleteCardDialog.js",["202"],"import React, {useState} from 'react';\r\nimport {TextField} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\n\r\nimport DialogScaffold from '../CommonComponents/DialogScaffold'\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n\r\n}));\r\n\r\nconst FieldsGrid = (props) => {\r\n const {setCardId, cardId, confirmFinal} = props;\r\n return(\r\n <React.Fragment>\r\n {\r\n !confirmFinal &&\r\n <TextField\r\n autoFocus\r\n fullWidth\r\n label='Card No.'\r\n margin='dense'\r\n value={cardId}\r\n onChange={e=>setCardId(e.target.value)}\r\n />\r\n }\r\n </React.Fragment>);\r\n};\r\n\r\nconst DeleteCardDialog = (props) => {\r\n const {open, setOpen, onConfirm, playerId, playerName} = props;\r\n const classes = useStyles();\r\n\r\n const [confirmFinal, setConfirmFinal] = useState(false);\r\n const [cardId, setCardId] = useState('');\r\n\r\n const handleOpen = () => {\r\n setConfirmFinal(false);\r\n setOpen();\r\n };\r\n\r\n const handleConfirm = () => {\r\n if (confirmFinal) {\r\n const cardId_ = cardId.split('-');\r\n onConfirm(playerId, cardId_[cardId_.length-1]);\r\n setOpen();\r\n setCardId('');\r\n setConfirmFinal(false);\r\n } else if (cardId.length > 0) {\r\n setConfirmFinal(true);\r\n };\r\n };\r\n\r\n const handleCancel = () => {\r\n setCardId('');\r\n };\r\n\r\n return (\r\n <DialogScaffold\r\n open={open}\r\n setOpen={handleOpen}\r\n onConfirm={handleConfirm}\r\n onCancel={handleCancel}\r\n title='Delete Card'\r\n contentText={`${confirmFinal ? \r\n `Are you sure to delete player ${playerId} ${playerName}'s card ${cardId}?` :\r\n `Specify which card you want to delete.`\r\n }`}\r\n FieldsGrid={<FieldsGrid \r\n cardId={cardId} \r\n setCardId={setCardId} \r\n confirmFinal={confirmFinal}\r\n />\r\n }\r\n confirmText={`${confirmFinal ? 'Confirm': 'Done'}`}\r\n />\r\n );\r\n};\r\n\r\nexport default DeleteCardDialog;\r\n\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\Admin\\DeletePlayerDialog.js",["203","204"],"import React from 'react';\r\nimport {Grid} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\n\r\nimport DialogScaffold from '../CommonComponents/DialogScaffold'\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n\r\n}));\r\n\r\nconst DeletePlayerDialog = (props) => {\r\n const {open, setOpen, onConfirm, playerId, playerName} = props;\r\n const classes = useStyles();\r\n\r\n const handleConfirm = () => {\r\n onConfirm(playerId);\r\n setOpen();\r\n };\r\n\r\n return(\r\n <DialogScaffold\r\n open={open}\r\n setOpen={setOpen}\r\n onConfirm={handleConfirm}\r\n title='Delete Player'\r\n contentText={`Are you sure to delete player ${playerId} ${playerName}?`}\r\n />\r\n );\r\n};\r\n\r\nexport default DeletePlayerDialog;\r\n\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\CommonComponents\\DialogScaffold.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\GameDrawer\\ResetPickedCellsDialog.js",["205"],"import React from 'react';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\n\r\nimport DialogScaffold from '../CommonComponents/DialogScaffold'\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n\r\n}));\r\n\r\nconst ResetPickedCellsDialog = (props) => {\r\n const {open, setOpen, onConfirm} = props;\r\n const classes = useStyles();\r\n\r\n const handleConfirm = () => {\r\n onConfirm();\r\n setOpen();\r\n };\r\n\r\n return(\r\n <DialogScaffold\r\n open={open}\r\n setOpen={setOpen}\r\n onConfirm={handleConfirm}\r\n title='Reset Draw Numbers'\r\n contentText={`Are you sure to reset the draw? This can't be undone.`}\r\n />\r\n );\r\n};\r\n\r\nexport default ResetPickedCellsDialog;\r\n\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView\\SelectCellChipArray.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\Classic\\DeckView\\SelectCellDialog.js",["206"],"import React, {useState} from 'react';\r\nimport {TextField} from '@material-ui/core';\r\nimport {makeStyles} from '@material-ui/core/styles';\r\n\r\nimport DialogScaffold from '../CommonComponents/DialogScaffold'\r\n\r\nconst useStyles = makeStyles(theme=> ({\r\n\r\n}));\r\n\r\nconst SelectCellDialog = (props) => {\r\n const {open, setOpen, onConfirm} = props;\r\n const classes = useStyles();\r\n\r\n const [number, setNumber] = useState('');\r\n\r\n const handleConfirm = () => {\r\n const numArr = number.split(',');\r\n onConfirm(numArr);\r\n setNumber('');\r\n setOpen(false);\r\n };\r\n\r\n const handleCancel = () => {\r\n setNumber('');\r\n setOpen(false);\r\n };\r\n\r\n return(\r\n <DialogScaffold\r\n open={open}\r\n setOpen={setOpen}\r\n onConfirm={handleConfirm}\r\n onCancel={handleCancel}\r\n title={`Select Number/s`}\r\n contentText='If adding multiple numbers, separate by comma. i.e. \"10,2,5\"'\r\n FieldsGrid={\r\n <TextField\r\n autoFocus\r\n fullWidth\r\n label='Number'\r\n margin='dense'\r\n value={number}\r\n onChange={e=>setNumber(e.target.value)}\r\n />\r\n }\r\n />\r\n );\r\n};\r\n\r\nexport default SelectCellDialog;\r\n\r\n","D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\LandingPage.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\pages\\GettingStarted.js",[],"D:\\Desktop\\bingo\\bingo-frontend\\src\\util\\useCreateRoom.js",[],{"ruleId":"207","severity":1,"message":"208","line":9,"column":3,"nodeType":"209","messageId":"210","endLine":9,"endColumn":7},{"ruleId":"207","severity":1,"message":"211","line":19,"column":8,"nodeType":"209","messageId":"210","endLine":19,"endColumn":13},{"ruleId":"207","severity":1,"message":"212","line":27,"column":10,"nodeType":"209","messageId":"210","endLine":27,"endColumn":14},{"ruleId":"213","replacedBy":"214"},{"ruleId":"215","replacedBy":"216"},{"ruleId":"213","replacedBy":"217"},{"ruleId":"215","replacedBy":"218"},{"ruleId":"207","severity":1,"message":"219","line":41,"column":7,"nodeType":"209","messageId":"210","endLine":41,"endColumn":19},{"ruleId":"207","severity":1,"message":"220","line":20,"column":12,"nodeType":"209","messageId":"210","endLine":20,"endColumn":21},{"ruleId":"207","severity":1,"message":"221","line":66,"column":38,"nodeType":"209","messageId":"210","endLine":66,"endColumn":47},{"ruleId":"207","severity":1,"message":"222","line":67,"column":21,"nodeType":"209","messageId":"210","endLine":67,"endColumn":31},{"ruleId":"223","severity":1,"message":"224","line":109,"column":8,"nodeType":"225","endLine":109,"endColumn":17,"suggestions":"226"},{"ruleId":"207","severity":1,"message":"227","line":18,"column":17,"nodeType":"209","messageId":"210","endLine":18,"endColumn":26},{"ruleId":"213","replacedBy":"228"},{"ruleId":"215","replacedBy":"229"},{"ruleId":"207","severity":1,"message":"230","line":85,"column":13,"nodeType":"209","messageId":"210","endLine":85,"endColumn":18},{"ruleId":"223","severity":1,"message":"231","line":209,"column":8,"nodeType":"225","endLine":209,"endColumn":17,"suggestions":"232"},{"ruleId":"223","severity":1,"message":"233","line":220,"column":10,"nodeType":"225","endLine":220,"endColumn":12,"suggestions":"234"},{"ruleId":"207","severity":1,"message":"235","line":19,"column":7,"nodeType":"209","messageId":"210","endLine":19,"endColumn":12},{"ruleId":"236","severity":1,"message":"237","line":89,"column":17,"nodeType":"238","messageId":"239","endLine":89,"endColumn":23},{"ruleId":"236","severity":1,"message":"237","line":92,"column":17,"nodeType":"238","messageId":"239","endLine":92,"endColumn":23},{"ruleId":"236","severity":1,"message":"237","line":95,"column":17,"nodeType":"238","messageId":"239","endLine":95,"endColumn":23},{"ruleId":"236","severity":1,"message":"237","line":98,"column":17,"nodeType":"238","messageId":"239","endLine":98,"endColumn":23},{"ruleId":"236","severity":1,"message":"237","line":101,"column":17,"nodeType":"238","messageId":"239","endLine":101,"endColumn":23},{"ruleId":"236","severity":1,"message":"237","line":104,"column":17,"nodeType":"238","messageId":"239","endLine":104,"endColumn":23},{"ruleId":"223","severity":1,"message":"240","line":149,"column":8,"nodeType":"225","endLine":149,"endColumn":21,"suggestions":"241"},{"ruleId":"223","severity":1,"message":"242","line":163,"column":8,"nodeType":"225","endLine":163,"endColumn":10,"suggestions":"243"},{"ruleId":"213","replacedBy":"244"},{"ruleId":"215","replacedBy":"245"},{"ruleId":"213","replacedBy":"246"},{"ruleId":"215","replacedBy":"247"},{"ruleId":"207","severity":1,"message":"227","line":18,"column":17,"nodeType":"209","messageId":"210","endLine":18,"endColumn":26},{"ruleId":"236","severity":1,"message":"237","line":125,"column":9,"nodeType":"238","messageId":"239","endLine":125,"endColumn":15},{"ruleId":"213","replacedBy":"248"},{"ruleId":"215","replacedBy":"249"},{"ruleId":"207","severity":1,"message":"250","line":3,"column":15,"nodeType":"209","messageId":"210","endLine":3,"endColumn":19},{"ruleId":"207","severity":1,"message":"251","line":3,"column":21,"nodeType":"209","messageId":"210","endLine":3,"endColumn":29},{"ruleId":"207","severity":1,"message":"252","line":3,"column":31,"nodeType":"209","messageId":"210","endLine":3,"endColumn":43},{"ruleId":"207","severity":1,"message":"253","line":20,"column":12,"nodeType":"209","messageId":"210","endLine":20,"endColumn":21},{"ruleId":"213","replacedBy":"254"},{"ruleId":"215","replacedBy":"255"},{"ruleId":"236","severity":1,"message":"237","line":135,"column":11,"nodeType":"238","messageId":"239","endLine":135,"endColumn":17},{"ruleId":"213","replacedBy":"256"},{"ruleId":"215","replacedBy":"257"},{"ruleId":"207","severity":1,"message":"258","line":4,"column":21,"nodeType":"209","messageId":"210","endLine":4,"endColumn":31},{"ruleId":"223","severity":1,"message":"259","line":55,"column":8,"nodeType":"225","endLine":55,"endColumn":17,"suggestions":"260"},{"ruleId":"223","severity":1,"message":"261","line":66,"column":8,"nodeType":"225","endLine":66,"endColumn":10,"suggestions":"262"},{"ruleId":"207","severity":1,"message":"263","line":31,"column":11,"nodeType":"209","messageId":"210","endLine":31,"endColumn":18},{"ruleId":"207","severity":1,"message":"263","line":31,"column":11,"nodeType":"209","messageId":"210","endLine":31,"endColumn":18},{"ruleId":"207","severity":1,"message":"264","line":2,"column":9,"nodeType":"209","messageId":"210","endLine":2,"endColumn":13},{"ruleId":"207","severity":1,"message":"263","line":13,"column":11,"nodeType":"209","messageId":"210","endLine":13,"endColumn":18},{"ruleId":"207","severity":1,"message":"263","line":12,"column":11,"nodeType":"209","messageId":"210","endLine":12,"endColumn":18},{"ruleId":"207","severity":1,"message":"263","line":13,"column":11,"nodeType":"209","messageId":"210","endLine":13,"endColumn":18},"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","'Lobby' is defined but never used.","'Home' is defined but never used.","no-native-reassign",["265"],"no-negated-in-lhs",["266"],["265"],["266"],"'cards_static' is assigned a value but never used.","'setRoomID' is assigned a value but never used.","'isLoading' is assigned a value but never used.","'isLoading2' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'match.path', 'playerId', 'roomId', and 'setClassicGameAdmin'. Either include them or remove the dependency array.","ArrayExpression",["267"],"'setCookie' is assigned a value but never used.",["265"],["266"],"'cards' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'roomId' and 'setClassicGameAdmin'. Either include them or remove the dependency array.",["268"],"React Hook useEffect has missing dependencies: 'cookies.userInfo', 'roomId', and 'setPickedCells'. Either include them or remove the dependency array.",["269"],"'bingo' is assigned a value but never used.","no-unreachable","Unreachable code.","BreakStatement","unreachableCode","React Hook useEffect has a missing dependency: 'intervalId'. Either include it or remove the dependency array.",["270"],"React Hook useEffect has missing dependencies: 'roomId' and 'setPickedCells'. Either include them or remove the dependency array.",["271"],["265"],["266"],["265"],["266"],["265"],["266"],"'List' is defined but never used.","'ListItem' is defined but never used.","'ListItemText' is defined but never used.","'ariaLabel' is assigned a value but never used.",["265"],["266"],["265"],["266"],"'withStyles' is defined but never used.","React Hook useEffect has missing dependencies: 'match.path', 'roomId', and 'setPlayerLogin'. Either include them or remove the dependency array.",["272"],"React Hook useEffect has missing dependencies: 'match.path', 'match.url', and 'roomId'. Either include them or remove the dependency array.",["273"],"'classes' is assigned a value but never used.","'Grid' is defined but never used.","no-global-assign","no-unsafe-negation",{"desc":"274","fix":"275"},{"desc":"276","fix":"277"},{"desc":"278","fix":"279"},{"desc":"280","fix":"281"},{"desc":"282","fix":"283"},{"desc":"284","fix":"285"},{"desc":"286","fix":"287"},"Update the dependencies array to be: [cookies, match.path, playerId, roomId, setClassicGameAdmin]",{"range":"288","text":"289"},"Update the dependencies array to be: [cookies, roomId, setClassicGameAdmin]",{"range":"290","text":"291"},"Update the dependencies array to be: [cookies.userInfo, roomId, setPickedCells]",{"range":"292","text":"293"},"Update the dependencies array to be: [intervalId, pickedCells]",{"range":"294","text":"295"},"Update the dependencies array to be: [roomId, setPickedCells]",{"range":"296","text":"297"},"Update the dependencies array to be: [cookies, match.path, roomId, setPlayerLogin]",{"range":"298","text":"299"},"Update the dependencies array to be: [match.path, match.url, roomId]",{"range":"300","text":"301"},[3173,3182],"[cookies, match.path, playerId, roomId, setClassicGameAdmin]",[6336,6345],"[cookies, roomId, setClassicGameAdmin]",[6654,6656],"[cookies.userInfo, roomId, setPickedCells]",[4087,4100],"[intervalId, pickedCells]",[4455,4457],"[roomId, setPickedCells]",[1684,1693],"[cookies, match.path, roomId, setPlayerLogin]",[2077,2079],"[match.path, match.url, roomId]"]