You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like how you're using propTypes and defaultProps, it always helps and makes the code more readable, and for a project the scale of yours, it's enough, but I'd rather see a common proptypes file where you assign your common types and reuse them everywhere, instead of copy-pasting types like the user for example, and modifying it on every instance whenever a change to the user object occurs.
Like this proptype:
The fact that you're separately importing components from material ui is good, reduces the bundle size, wished that you did this in every other component.
I'm not sure why would you use makeStyles and useMediaQuery when you've got better functionality in pure CSS, but either ways, you should have your styles in a separate file, so that you don't spam your files and fill them to 300 lines
You must be able to write cleaner code than this, having everything mixed up together is spaghetti code.
You can either:
Separate your concerns, have your code split by functionality, as having your API calls in one place, your reducers in another, your components in another, your containers, your styles, ...etc. Having your code split by function helps you reusing every functionality.
Separate your components, have your code split by component, meaning that you'll have your component, and its container, and it's API calls, and its style, and everything required to run that component, all in one folder (NOT FILE), this would guarantee that adding or removing a component to or from the UI will not affect any other part of the UI.
But what you cannot do, is have everything that comes to mind all in one file, thrown to be run whenever called.
Consistency, you either use useStyles, or use pure css, but not both, you can name your css files index.css, style.css or CardContainer.css, but not a combination of them.
Looking at your Footer/index.js, whenever any component of yours exceeds the 120 lines limit, this means you're doing something wrong. And whenever your footer exceeds the 20 lines limit, you're definitely doing something wrong.
Same for your header (700 lines!).
How about this? Try as much as possible not to nest ternary operators, I totally understand how easy the ternary is and how comforting it sounds, but it's not always readable.
Someone has a problem running their application lol, upgrade or downgrade your Node version, that should solve your error.
Good work for starters, also for a project the size of a week, but you have to do much better in most other cases for a real job, every component you write is expected to be scalable and reusable everywhere, or else your employer will ask you to put a button somewhere your button isn't implemented to handle, and you'd have to rewrite it and modify every instance of that Button to fit the place.
The text was updated successfully, but these errors were encountered:
First of, neat coding, fan of your works
I like how you're using propTypes and defaultProps, it always helps and makes the code more readable, and for a project the scale of yours, it's enough, but I'd rather see a common proptypes file where you assign your common types and reuse them everywhere, instead of copy-pasting types like the user for example, and modifying it on every instance whenever a change to the user object occurs.
Like this proptype:
MASA-Store/client/src/component/Card/index.js
Line 321 in 463acba
MASA-Store/client/src/component/ButtonComponent/index.js
Line 40 in 463acba
Check out a library called
classnames
, makes the code a bit cleaner with things like this oneMASA-Store/client/src/component/ButtonComponent/index.js
Lines 5 to 7 in 463acba
The fact that you're separately importing components from material ui is good, reduces the bundle size, wished that you did this in every other component.
MASA-Store/client/src/component/Card/index.js
Line 23 in 463acba
MASA-Store/client/src/component/Card/index.js
Line 179 in 463acba
I'm not sure why would you use
makeStyles
anduseMediaQuery
when you've got better functionality in pure CSS, but either ways, you should have your styles in a separate file, so that you don't spam your files and fill them to 300 linesMASA-Store/client/src/component/Card/index.js
Lines 178 to 314 in 463acba
This entire section could've been split into two separate sections, this would increase the readability of your code.
Check out
i18n
for translation. A must have if your website is using an RTL layout or if it was multilingualMASA-Store/client/src/component/CardContainer/index.js
Lines 39 to 52 in 463acba
You must be able to write cleaner code than this, having everything mixed up together is spaghetti code.
You can either:
But what you cannot do, is have everything that comes to mind all in one file, thrown to be run whenever called.
Check this article https://dev.to/surajjadhav/how-should-we-structure-our-react-code-1-2-1ecm
Consistency, you either use
useStyles
, or use purecss
, but not both, you can name your css filesindex.css
,style.css
orCardContainer.css
, but not a combination of them.MASA-Store/client/src/component/CardContainer/index.js
Line 128 in 463acba
LOL
Looking at your
Footer/index.js
, whenever any component of yours exceeds the 120 lines limit, this means you're doing something wrong. And whenever your footer exceeds the 20 lines limit, you're definitely doing something wrong.Same for your header (700 lines!).
MASA-Store/client/src/component/InputField/index.js
Lines 41 to 48 in 463acba
How about this? Try as much as possible not to nest ternary operators, I totally understand how easy the ternary is and how comforting it sounds, but it's not always readable.
MASA-Store/client/src/component/index.js
Line 11 in 463acba
Why?
Instead of this:
MASA-Store/client/src/pages/index.js
Lines 1 to 39 in 463acba
Check easier syntaxes here https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export
looking at your utilities, no empty files, and you will definitely not have a file for each individual function you need in your application.
MASA-Store/client/src/App.js
Lines 79 to 194 in 463acba
Just create an array of endpoints and map through that instead of repeating code.
MASA-Store/client/.env
Line 1 in 463acba
Someone has a problem running their application lol, upgrade or downgrade your Node version, that should solve your error.
Good work for starters, also for a project the size of a week, but you have to do much better in most other cases for a real job, every component you write is expected to be scalable and reusable everywhere, or else your employer will ask you to put a button somewhere your button isn't implemented to handle, and you'd have to rewrite it and modify every instance of that Button to fit the place.
The text was updated successfully, but these errors were encountered: