Open tranduybau opened 1 year ago
Hello @tranduybau, good work!
Final result: ✅ passed 70% of the requirements
We also have some comments for your work:
onChangePage
function currently seems to expect the event directly. However, in most pagination implementations, you'd likely want to pass the page number directly rather than the event object.
https://github.com/tranduybau/df-frontend-2023/blob/659f11c1a4836180b92205326cf52ce13a0c9a16/assignment-2/src/App.jsx#L36theme === Theme.DARK && 'dark'
, it's clearer to use a ternary: theme === Theme.DARK ? 'dark' : ''
.
https://github.com/tranduybau/df-frontend-2023/blob/659f11c1a4836180b92205326cf52ce13a0c9a16/assignment-2/src/App.jsx#L93onChange
event in the following assignments instead.switch(true)
is unconventional. You might want to simplify this logic using conditional rendering or more straightforward if-else.
https://github.com/tranduybau/df-frontend-2023/blob/659f11c1a4836180b92205326cf52ce13a0c9a16/assignment-2/src/components/Pagination/index.jsx#L85
is hard-coded in multiples places in the pagination. Consider using a constant like ITEMS_PER_PAGE
.
https://github.com/tranduybau/df-frontend-2023/blob/659f11c1a4836180b92205326cf52ce13a0c9a16/assignment-2/src/components/Pagination/index.jsx#L35Hi @zlatanpham , thank for your feedback. Here is some replying from me:
onChangePage
function, I used the event object as a parameter because of don't want to create another function for format the parameter:
const onChange = (event) => onChangePage(event.target.value)
This is wasted of time, also increase the number of lines of code. The event
object is a native one from HTML.
switch (true)
is not a unconventional, but it is a rule from SonarLint for using too many conditions in if-else state.I had a face to face meeting with @zlatanpham, thank you for that. We can close the issue now ✅
Link:
https://df-frontend-2023-vxcm.vercel.app/
Note for team:
Great job, thank you for the project!