Feedback & Code Review od Mentora Recenzenta (Jan Owsiany)#103
Feedback & Code Review od Mentora Recenzenta (Jan Owsiany)#103Nefariusek wants to merge 301 commits intofeedback/mentor-recenzentfrom
Conversation
Feature/issue 21
Feature issue#14
Feature/issue 27
[hotfix] Making the adoption bubble behave like the fact bubble
Enhancement/issue 73
Feature/issue 62
Fixing paths and urls for the production version
Fixing paths for the production version
added responsive view to all screens
Release 1.0
janowsiany
left a comment
There was a problem hiding this comment.
Unfortunately, I couldn't go through everything deeply, I focused on JavaScript part and just looked briefly on CSS
The general comment is i like when the project uses a consistent naming convention, i did not find it here 😅
On the other congrats on linking it all together, i see a huge effort here 🍝, as for the first project the scope of it is impressive 👏
Also, the code in multiple places had great quality and looked very professionally 🎖️
src/api/FactsController.js
Outdated
| const factJson = await factResponse.json(); | ||
| const imgJson = await imgResponse.json(); |
There was a problem hiding this comment.
| const factJson = await factResponse.json(); | |
| const imgJson = await imgResponse.json(); | |
| const [factJson, imgJson] = await Promise.all([factResponse.json(), imgResponse.json()]); |
src/api/FactsController.js
Outdated
| const factResult = { | ||
| fact: factJson.text, | ||
| imageUrl: imgJson[0].url, | ||
| }; | ||
| return factResult; |
There was a problem hiding this comment.
| const factResult = { | |
| fact: factJson.text, | |
| imageUrl: imgJson[0].url, | |
| }; | |
| return factResult; | |
| return { | |
| fact: factJson.text, | |
| imageUrl: imgJson[0].url, | |
| }; |
i like to skip variable declaration if it is used only for return
src/api/FactsController.js
Outdated
| const randomNumber = randomIntFromInterval(0, animalTypes.length - 1); | ||
| const randomAnimalType = animalTypes[randomNumber]; |
There was a problem hiding this comment.
| const randomNumber = randomIntFromInterval(0, animalTypes.length - 1); | |
| const randomAnimalType = animalTypes[randomNumber]; | |
| const randomInt = randomIntFromInterval(0, animalTypes.length - 1); | |
| const randomAnimalType = animalTypes[randomInt]; |
when there is a name in getter function then i like to have the corresponding name for variable, using consistent vocabulary is IMHO important
src/api/getQuizQuestions.js
Outdated
| const questionsApis = { | ||
| DOGS: { url: 'https://api.thedogapi.com/v1/breeds', api_key: '62b8cc9a-2c13-4eec-abe2-80703eabb0a6' }, | ||
| CATS: { url: 'https://api.thecatapi.com/v1/breeds', api_key: '2d4cf1ee-1883-474f-80ab-f931262fd79b' }, | ||
| }; |
There was a problem hiding this comment.
i do not like mixing cases and naming conventions for variables
src/api/getQuizQuestions.js
Outdated
| DOGS: { url: 'https://api.thedogapi.com/v1/breeds', api_key: '62b8cc9a-2c13-4eec-abe2-80703eabb0a6' }, | ||
| CATS: { url: 'https://api.thecatapi.com/v1/breeds', api_key: '2d4cf1ee-1883-474f-80ab-f931262fd79b' }, |
There was a problem hiding this comment.
I think it is important to tell the team that putting api_key in git repositories is antipattern and should never happen
src/components/timer/quiz-timer.js
Outdated
| clearInterval(timer); | ||
| } | ||
|
|
||
| function timerDigits(time_value) { |
There was a problem hiding this comment.
inconsistent variable naming time_value
| import '../../style.css'; | ||
| import Button from '../../components/Button/Button'; | ||
|
|
||
| class QuizSettings { |
There was a problem hiding this comment.
to be honest i do not like the way it is implemented with static methods, seems overengineered for me
| }, 1000); | ||
| } | ||
|
|
||
| export function stopTimer() { |
src/views/QuizView/quizView.js
Outdated
| const time = timerMinutes * 60 + timerSeconds; | ||
| return time; |
There was a problem hiding this comment.
| const time = timerMinutes * 60 + timerSeconds; | |
| return time; | |
| return timerMinutes * 60 + timerSeconds; |
src/views/QuizView/quizView.js
Outdated
| timerMinutes = document.getElementById('timer-minutes').innerText; | ||
| timerSeconds = document.getElementById('timer-seconds').innerText; |
There was a problem hiding this comment.
I do not like that the state(minutes and seconds) is shared through HTML element 😞
There was a problem hiding this comment.
used export/import instead
|
changes introduced. |
JSDoc component documentation
add time manager as singleton class
No description provided.