-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 10.8 KB
/
.eslintcache
1
[{"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/index.js":"1","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/App.js":"2","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/firebase-conf.js":"3","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/Display.js":"4","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/VocabPads.js":"5","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/VocabPad.js":"6","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/Loading.js":"7","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/icons-bundle.js":"8"},{"size":244,"mtime":1611335143100,"results":"9","hashOfConfig":"10"},{"size":2493,"mtime":1611764661932,"results":"11","hashOfConfig":"10"},{"size":1084,"mtime":1611335983937,"results":"12","hashOfConfig":"10"},{"size":1883,"mtime":1611764661947,"results":"13","hashOfConfig":"10"},{"size":1255,"mtime":1611761276972,"results":"14","hashOfConfig":"10"},{"size":2600,"mtime":1618691002710,"results":"15","hashOfConfig":"10"},{"size":210,"mtime":1611761276967,"results":"16","hashOfConfig":"10"},{"size":78727,"mtime":1611252222085,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"ee9xew",{"filePath":"21","messages":"22","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"23","usedDeprecatedRules":"20"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"32","usedDeprecatedRules":"20"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/index.js",[],["37","38"],"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/App.js",["39"],"import React, { useState, useEffect } from 'react';\nimport Display from './components/Display';\nimport VocabPads from './components/VocabPads';\nimport './App.scss'\n\nfunction App() {\n const [vocabs, setVocabs] = useState([]);\n const [selected, setSelected] = useState('');\n const [category, setCategory] = useState('fruits-vegs');\n const keypad = ['q', 'w', 'e', 'a', 's', 'd', 'z', 'x', 'c'];\n const [playing, setPlaying] = useState(false);\n\n const getVocabs = (vocabs) => {\n const endpointPrefix = 'https://5f9b77e3856f4c00168bffb3.mockapi.io/';\n\n fetch(endpointPrefix+vocabs)\n .then(response => response.json())\n .then(data => { setVocabs(data)});\n }\n\n useEffect(() => {\n switch (category) {\n case 'fruits-vegs':\n getVocabs('fruitsVegsVocab');\n break;\n case 'animals':\n getVocabs('animalsVocab');\n break;\n default:\n break;\n }\n }, [category]);\n\n const handleCategoryChange = (event) => {\n switch (event.target.value) {\n case 'fruits-vegs':\n setCategory('fruits-vegs');\n break;\n case 'animals':\n setCategory('animals');\n break;\n default:\n break;\n }\n }\n\n const handleKeyPress = (event) => {\n const keyIndex = keypad.indexOf(event.key);\n if (keyIndex >= 0 && keyIndex <= 8 && !playing) {\n setSelected(event.key);\n setPlaying(!playing);\n }\n }\n\n useEffect(() => {\n document.addEventListener('keypress', handleKeyPress);\n return () => {\n document.removeEventListener('keypress', handleKeyPress);\n }\n }, [playing]);\n\n return (\n <div id=\"app-wrapper\">\n <div id=\"arabic-for-kids\" className=\"px-5 px-lg-5 pb-5 pt-5 pt-md-3 my-0 my-md-5 my-lg-0\">\n <h1 className=\"pb-2 noselect\">Arabic for Kids</h1>\n <div className=\"container\">\n <div className=\"row justify-content-center\">\n <VocabPads\n keypad={keypad}\n vocabs={vocabs}\n selected={selected}\n setSelected={setSelected}\n playing={playing}\n setPlaying={setPlaying}\n category={category}\n />\n <Display\n keypad={keypad}\n vocabs={vocabs}\n selected={selected}\n category={category}\n setCategory={setCategory}\n handleCategoryChange={handleCategoryChange}\n />\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nexport default App;","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/firebase-conf.js",[],"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/Display.js",[],"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/VocabPads.js",[],"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/VocabPad.js",["40","41","42"],"import { useEffect, useRef } from \"react\";\nimport \"./VocabPad.scss\";\nimport { Icon } from \"@iconify/react-with-api\";\nimport \"../icons-bundle.js\";\nimport audioRef from \"../firebase-conf\";\n\nfunction VocabPad({\n keypad,\n vocab,\n selected,\n setSelected,\n playing,\n setPlaying,\n category,\n setDownloading,\n index,\n}) {\n const audio = useRef(null);\n\n const getClip = (category, name, index) => {\n if (window[`${name}AudioURL`]) {\n audio.current.src = window[`${name}AudioURL`];\n setDownloading((prevDownlads) => {\n const newDownloads = [...prevDownlads];\n newDownloads[index] = false;\n return newDownloads;\n });\n } else {\n const audioURL = `${category}/${name}.mp3`;\n setDownloading((prevDownlads) => {\n const newDownloads = [...prevDownlads];\n newDownloads[index] = true;\n return newDownloads;\n });\n\n audioRef\n .child(audioURL)\n .getDownloadURL()\n .then((url) => {\n let xhr = new XMLHttpRequest();\n xhr.responseType = \"blob\";\n xhr.onload = () => {\n let blob = xhr.response;\n window[`${name}AudioURL`] = window.URL.createObjectURL(blob);\n audio.current.src = window[`${name}AudioURL`];\n setDownloading((prevDownlads) => {\n const newDownloads = [...prevDownlads];\n newDownloads[index] = false;\n return newDownloads;\n });\n };\n xhr.open(\"GET\", url);\n xhr.send();\n })\n .catch((error) => {\n console.log(error.message);\n });\n }\n };\n\n useEffect(() => {\n getClip(category, vocab.translation, index);\n }, [vocab]);\n\n const toggle = () => {\n if (!playing) {\n setSelected(keypad);\n setPlaying(!playing);\n }\n };\n\n useEffect(() => {\n if (playing && selected === keypad) audio.current.play();\n }, [playing, keypad, selected]);\n\n useEffect(() => {\n audio.current.addEventListener(\"ended\", () => setPlaying(false));\n return () => {\n audio.current.removeEventListener(\"ended\", () => setPlaying(false));\n };\n }, []);\n\n return (\n <div\n className=\"vocab-pad\"\n id={vocab.translation}\n key={vocab.id}\n onClick={toggle}\n >\n <span className=\"keypad\">{keypad.toUpperCase()}</span>\n <Icon className=\"iconify\" icon={vocab.icon} />\n\n <audio ref={audio} id={keypad} className=\"clip\">\n Your browser does not support the <code>audio</code> element\n </audio>\n\n <span>{vocab.translation}</span>\n </div>\n );\n}\n\nexport default VocabPad;\n","/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/components/Loading.js",[],"/mnt/Data/Rio/Code/Web Development/FCC Projects/Front End Development Libraries Projects/arabic-for-kids/src/icons-bundle.js",[],{"ruleId":"43","replacedBy":"44"},{"ruleId":"45","replacedBy":"46"},{"ruleId":"47","severity":1,"message":"48","line":60,"column":6,"nodeType":"49","endLine":60,"endColumn":15,"suggestions":"50"},{"ruleId":"47","severity":1,"message":"51","line":63,"column":6,"nodeType":"49","endLine":63,"endColumn":13,"suggestions":"52"},{"ruleId":"47","severity":1,"message":"53","line":79,"column":13,"nodeType":"54","endLine":79,"endColumn":20},{"ruleId":"47","severity":1,"message":"55","line":81,"column":6,"nodeType":"49","endLine":81,"endColumn":8,"suggestions":"56"},"no-native-reassign",["57"],"no-negated-in-lhs",["58"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'handleKeyPress'. Either include it or remove the dependency array.","ArrayExpression",["59"],"React Hook useEffect has missing dependencies: 'category', 'getClip', and 'index'. Either include them or remove the dependency array.",["60"],"The ref value 'audio.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'audio.current' to a variable inside the effect, and use that variable in the cleanup function.","Identifier","React Hook useEffect has a missing dependency: 'setPlaying'. Either include it or remove the dependency array. If 'setPlaying' changes too often, find the parent component that defines it and wrap that definition in useCallback.",["61"],"no-global-assign","no-unsafe-negation",{"desc":"62","fix":"63"},{"desc":"64","fix":"65"},{"desc":"66","fix":"67"},"Update the dependencies array to be: [handleKeyPress, playing]",{"range":"68","text":"69"},"Update the dependencies array to be: [category, getClip, index, vocab]",{"range":"70","text":"71"},"Update the dependencies array to be: [setPlaying]",{"range":"72","text":"73"},[1574,1583],"[handleKeyPress, playing]",[1692,1699],"[category, getClip, index, vocab]",[2129,2131],"[setPlaying]"]