As a developerI want to have a clean and well structured codebase
In order to keep the overview and be able to integrate future features more easily
Acceptance criteria
The flashcard is not supposed to be flippable when the delete confirmation mode is visible
The linter should not throw a warning at any point in the code
All setTimeouts should be wrapped in useEffects.
The code of the flashcard stack in training/[id].js should be simpler if possible with less elements wrapping each other
In Menu.js the code should be less repetitive
The code should be free of unnecessarily passed props
There should be no repetitive styled components
Frequently used functions could be stored in a central location if necessary
Tasks
[x] Create branch refactoring/cleanup
[x] Stop flashcard from flipping when isDelete === true
[x] Look for linter warnings and improve the code to avoid them (e.g. useCallback in Layout.js)
[x] Look for setTimeouts and wrap them inside useEffects
[x] Look at training/[id].js and check if a simplification with less elements is possible
[x] Summarize the code in Menu.js to avoid repeating code
[x] Go through code and look for unnecessarily passed props, follow their path and delete them
[x] Repeating styled components should be moved to a StyledComponents and imported where needed
[x] Check if a utils folder to store functions that are used repeatedly is useful. If necessary implement it, store the relevant functions in it and import the functions where they're used
Refactoring and Improvements
Value proposition
As a developer I want to have a clean and well structured codebase In order to keep the overview and be able to integrate future features more easily
Acceptance criteria
training/[id].js
should be simpler if possible with less elements wrapping each otherMenu.js
the code should be less repetitiveTasks
refactoring/cleanup
isDelete === true
useCallback
inLayout.js
)training/[id].js
and check if a simplification with less elements is possibleMenu.js
to avoid repeating codeStyledComponents
and imported where neededutils
folder to store functions that are used repeatedly is useful. If necessary implement it, store the relevant functions in it and import the functions where they're used