-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
fix: handle loading states for project details for a single project #8492
fix: handle loading states for project details for a single project #8492
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to combine state specific data myself when it starts to hurt me. If you feel like we're at this stage and you can timebox it to a resonable timeframe then why not. Otherwise I'd clean it up with the next major change in this area. I've shifted data-loading myself a few time it didn't work as expected :)
8ef2f86
to
af7c48a
Compare
This PR updates the use of references on the project details page to handle the loading state for a single project.
Now, if a project is loading, it'll show skeleton loaders for the relevant boxes:
I've also updated the state type we use for this to be more accurate. However, it feels like it's getting kinda messy they way we handle it now. I wouldn't mind refactoring the output of the hook into something more like this data type to make handling more explicit. (Shamelessly stolen from Elm, but iykyk)
Also, I had some issues with applying the
data-loading
attribute to components, where it seemed to work in some cases, but not in others. For instance, forDataError
andContactAdmins
, it didn't work just settingdata-loading
on the component invocation inMyProjects
, so I wrapped them both in data-loading divs instead. But happy to hear if there's a trick I missed.After refactoring: