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

Make nav items stateful #345

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Brikaa
Copy link

@Brikaa Brikaa commented Feb 15, 2022

Fixes a bug where the navbar won't re-render if the user signs out while they are on the homepage.

For layout.tsx component

  • Gets rid of AuthState since it is not used in the React element.
  • Adds a state for nav items and passes it to navigation.tsx.

For profile.tsx component

  • Gets rid of onBlur in DropDown since it has no effect.
  • Gets rid of useRef since it is not used.
  • Removes the click event listener on the profile image on signing out to avoid changing the state of a removed component.
  • Uses useEffect() to add and remove event listeners on opening and closing the dropdown

For recent-devs mock

  • Makes the IDs of the recent devs unique to avoid giving errors in the console
  • Uses UTF-8 characters

@Brikaa Brikaa requested a review from a team as a code owner February 15, 2022 12:25
@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #345 (d352038) into master (2cac0fd) will increase coverage by 0.50%.
The diff coverage is 78.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #345      +/-   ##
==========================================
+ Coverage   60.87%   61.38%   +0.50%     
==========================================
  Files         126      126              
  Lines        1958     2191     +233     
  Branches      380      528     +148     
==========================================
+ Hits         1192     1345     +153     
- Misses        731      840     +109     
+ Partials       35        6      -29     
Impacted Files Coverage Δ
src/components/shared/navigation/profile.tsx 64.00% <40.00%> (-1.00%) ⬇️
src/components/shared/navigation/navigation.tsx 81.25% <75.00%> (ø)
src/components/shared/layout/layout.tsx 65.90% <100.00%> (-4.10%) ⬇️
src/components/shared/buttons/project-button.tsx 20.00% <0.00%> (-13.34%) ⬇️
src/components/shared/page/page-body.tsx 87.50% <0.00%> (-12.50%) ⬇️
src/components/account/account-settings.tsx 78.94% <0.00%> (-7.72%) ⬇️
src/components/shared/form/controls2.tsx 36.84% <0.00%> (-6.91%) ⬇️
src/components/shared/social-icon.tsx 26.66% <0.00%> (-6.67%) ⬇️
src/components/shared/seo.tsx 89.47% <0.00%> (-4.28%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cac0fd...d352038. Read the comment docs.

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.

1 participant