-
Notifications
You must be signed in to change notification settings - Fork 1
Feedback & Code Review od Mentora Recenzenta (Jan Owsiany) #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feedback/mentor-recenzent
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const factJson = await factResponse.json(); | |
const imgJson = await imgResponse.json(); | |
const [factJson, imgJson] = await Promise.all([factResponse.json(), imgResponse.json()]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/api/FactsController.js
Outdated
const factResult = { | ||
fact: factJson.text, | ||
imageUrl: imgJson[0].url, | ||
}; | ||
return factResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/api/FactsController.js
Outdated
const randomNumber = randomIntFromInterval(0, animalTypes.length - 1); | ||
const randomAnimalType = animalTypes[randomNumber]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not like mixing cases and naming conventions for variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is important to tell the team that putting api_key
in git repositories is antipattern and should never happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to .env
src/components/timer/quiz-timer.js
Outdated
clearInterval(timer); | ||
} | ||
|
||
function timerDigits(time_value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent variable naming time_value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to timeValue
import '../../style.css'; | ||
import Button from '../../components/Button/Button'; | ||
|
||
class QuizSettings { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest i do not like the way it is implemented with static methods, seems overengineered for me
src/components/timer/quiz-timer.js
Outdated
}, 1000); | ||
} | ||
|
||
export function stopTimer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
src/views/QuizView/quizView.js
Outdated
const time = timerMinutes * 60 + timerSeconds; | ||
return time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const time = timerMinutes * 60 + timerSeconds; | |
return time; | |
return timerMinutes * 60 + timerSeconds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like that the state(minutes and seconds) is shared through HTML element 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used export/import instead
changes introduced. |
JSDoc component documentation
add time manager as singleton class
No description provided.