refactoring and optimization
Maximover opened this issue · comments
Wojciech Pela commented
refactoring and optimization
Daniel Fidor commented
- Remove repetitive code (eg. PrivateRoute's validate function)
- Add interfaces and/or types instead of any
- Prettify code
- Remove "solvable" eslint-disable's
- Add error handling
- Remove unused vars
- Remove unused, commented code
- Fix router - move "layout specific" divs to views
- Extract repetitive utility classes to single classes - similar to your
.btn
classes - Move similar components to folders (eg. AddBook and UpdateBook in single directory)
- Maybe add prop to sidebar that will decide what's inside, and remove SidebarAdmin? I think it would remove the need to change classes in both files when you decide to change sidebar styles.
- Use consistent function type - I'd prefer arrow function - and add
FC
type to them - Remove
<br>
where it isn't explicitly needed and prefer to style such things with css - Replace placeholders such as "siema" and replace them with suitable messages
- Add and display loading and error state to requests
- Make sure the file name is the same as component name
- Be awesome! :3