chore: refactor shell to individual files#16893
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
There was a problem hiding this comment.
Move to a hook that can live outside of shell
There was a problem hiding this comment.
Same goes as above with its helper fuctions
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (10/01/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (10/01/24)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Create a hook that boots intercom - no need for this to live directly in shell either. Means we can control when the "me" query is called much easier i the future as it was being called on every render
There was a problem hiding this comment.
Wow thats a lot less lines
| return bannersHeight; | ||
| }; | ||
|
|
||
| const useBanners = () => { |
There was a problem hiding this comment.
Lets just have one hook to get all banners and calculate the height
joeauyeung
left a comment
There was a problem hiding this comment.
Great refactor @sean-brydon
Test Cases
- Desktop view ✅
- Reduced side bar ✅
- Mobile nav ❌
- Unauthed redirect to login page ✅
- Onboarding trigger ✅
Blocking
- If we're refactoring right now can we abstract some of the hooks logic so we can prepare for the app router migration? If it's too big then I'm ok having this in a follow up PR. FYI @hbjORbj
- In the mobile nav container when clicking
MoreI get this error

Non-blocking
- Have you considered using
useCallbackat all to help with preventing rerenders? I'm also ok with having it in a follow up PR
| onInteractOutside={() => { | ||
| setMenuOpen(false); | ||
| }} | ||
| className="min-w-56 hariom group overflow-hidden rounded-md"> |
There was a problem hiding this comment.
Thats a great question lol
100%! As i mentioned in the PR description - i've not made any perf improvements here. Just making the component more manageable!
I don't understand what you mean here? I've tried to abstract all hooks that were present in the shell
|
E2E results are ready! |
joeauyeung
left a comment
There was a problem hiding this comment.
Navigation is now working as expected.
In terms of my abstracting hooks logic comment. We can't call hooks in server components so ideally I would have liked to see the logic inside of the hooks to be abstracted. Although looking through it some more I realize it would be too big for this PR so let's cross that bridge when we get there.
What does this PR do?
This PR is one of many that refactors the Shell component out of one file and into many sub components. This PR is just extracting with no performance improvements. They will happen in a follow up PR
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist