Fix: Resolve ESLint issues in UserIcon.tsx#396
Conversation
|
@peynadol is attempting to deploy a commit to the lmcrean's projects Team on Vercel. A member of the Team first needs to authorize it. |
violaberg
left a comment
There was a problem hiding this comment.
I would add 'navigate' variable back and replace 'window.location.href' which would resolve ESlint error as well about unused variable. Otherwise well done and congrats on the first open source PR!
Thanks! I noticed that navigate was originally present but wasn’t being used. I assumed it was replaced with window.location.href as a temporary workaround for the hard refresh issue mentioned elsewhere. Appreciate the kind words. Definitely a bit nerve-wracking doing a first PR 😅 |
Fixes #395
Description
This PR resolves ESLint issues in
UserIcon.tsx:navigatetype="button"to all button elementsnpx eslint src/components/navbar/UserIcon.tsxNo visual or functional changes.
How to Test
cd frontend && npm installnpx eslint src/components/navbar/UserIcon.tsxChecklist
mainbranchnpm run buildto confirm no build errorsnpm run lintand fixed all issuesAdditional Notes
While resolving the linting issues, I noticed a couple of areas that could be worth reviewing in the future:
console.log()statements inUserIcon.tsxthat appear to be for debugging these could be removed.window.location.hreffor navigation, which works, but replacing it withuseNavigate()fromreact-router-domwould avoid full page reloads and improve UX consistency within the SPA.Happy to open a follow up issue or help with cleanup if useful!
This is my first open source PR, so i'm happy to make adjustments if needed.