Skip to content
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

Quick refactor of layouts/dashboard/index.js #3

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

Lissy93
Copy link
Contributor

@Lissy93 Lissy93 commented Jul 9, 2023

Another quick PR, this one just applies a few small improvements to the dashboard/index.js file, to remove some unnecessary code, make it a tiny be more performant, and to neaten up a few things.

Summary of changes:

  • In the sortCardsByDate function, I parsed the date and just sorted numerically to avoid an extra operation
  • The tagsToString function was simplified using join
  • Updated the generateCards function to first sort the projects, then filter them, and finally map them to JSX elements
  • Made sure that the functions filterProjectsByQuery and generateCardElement are called properly in generateCards
  • And updated to call to generateCards in the Dashboard component with the necessary arguments
  • Removed unused imports
  • Removed unused variables
  • Removed trailing spaces and excess blank lines
  • Improved efficiency of sorting algo
  • Extracted some logic out of the markup
  • Renamed a few vars to be more readable
  • Fixed some indentation
  • Ran prettier

I couldn't find the tests, so u might want to double check it works as you expect before merging ;)

@netlify
Copy link

netlify bot commented Jul 9, 2023

Deploy Preview for stirring-tapioca-7b9034 ready!

Name Link
🔨 Latest commit 56f2b50
🔍 Latest deploy log https://app.netlify.com/sites/stirring-tapioca-7b9034/deploys/64ab2f3c38da9c00071a169d
😎 Deploy Preview https://deploy-preview-3--stirring-tapioca-7b9034.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ANG13T
Copy link
Owner

ANG13T commented Jul 10, 2023

Thanks for cleaning things up, haha! I really appreciate it ✨🚀

@ANG13T ANG13T merged commit 57c3395 into ANG13T:main Jul 10, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants