Repository navigation
feature/fetching-skeleton - #208
Robin-deng617 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
joengy
left a comment
There was a problem hiding this comment.
Only few small changes Robin, sorry for the delay in comments was really busy last week. Shouldn't take too long to fix just let me know if you have any issues.
| queryFn: () => | ||
| fetchFromCMS<EventsResponse>('/events?depth=1&limit=100&sort=-date'), | ||
| select: (data) => data.docs, | ||
| export function useExecs() { |
There was a problem hiding this comment.
I think this file got overwritten by mistake.
useEvents.ts now holds an exact copy of useExecs (same name, same code) instead of the events hooks it had before. Nothing imports from useEvents.ts at the moment, so nothing breaks yet. But we'd end up with two useExecs hooks, and if someone later imports useEvents they'll get the wrong thing with no warning.
Suggested fix: revert this file to what's on main (git checkout origin/main -- web/src/hooks/useEvents.ts). If the events hooks aren't needed any more, deleting the file is fine too. Just not a copy of useExecs.
| import SponsorsControlsPlaceholder from './components/SponsorsControlsPlaceholder' | ||
| import SponsorsGridSkeleton from './components/SponsorsGridSkeleton' | ||
|
|
||
| export default function SponsorsLoading() { |
There was a problem hiding this comment.
This file copies most of the sponsors page layout (hero, heading, the mascot / "Contact Us" section, footer) so the loading state looks the same.
You already used a nicer pattern on the home page in this PR: move the part that fetches data into its own small async component and wrap only that in <Suspense fallback={...}>. For sponsors that would mean:
page.tsxrenders the hero, heading and contact section straight away (they don't need data),- the sponsor-of-the-week card and the grid sit inside
<Suspense>withHighlightCardSkeleton/SponsorsGridSkeletonas the fallback.
Then this loading.tsx file and SponsorsControlsPlaceholder aren't needed. As a bonus, people won't see a search box that looks usable but ignores what they type while the page is loading.
What does this PR do?
Adds a skeleton to all components that require fetching
Type of change
Checklist
feature/,fix/,chore/,hotfix/)Linked Issues
Closes #
Addresses #204
Related to #