-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: Add global loading indicator to top nav #176
feat: Add global loading indicator to top nav #176
Conversation
ab7399c
to
dad1da4
Compare
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.
Thanks @gustavoguichard for taking this on! Mostly little suggestions/code nits
app/ui/global-loading.tsx
Outdated
@@ -0,0 +1,42 @@ | |||
import * as React from "react"; |
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.
Small nit: can we import the hooks from React
. It's not a big thing, just trying to get more uniform into this codebase to that pattern
import * as React from "react"; | |
import { useRef, useState, useEffect } from "react"; |
@brophdawg11 since you added the suggestion I wanted to bring this to your attention in case you wanted to provide feedback |
@brookslybrand , applied the suggestions ;) |
* feat: Add global loading indicator to top nav * chore: Apply some of Brook's suggestions to global-loading code
According to @brophdawg11 's suggestion and issue #163 , I added this POC to the
root.tsx
.In the example below I added a
await sleep(2000)
to the blog loaders and the theme switch action to see the complete animation and the places where the progressbar stops in both slow actions and loaders.This was taken from my blog post and I've been using this code successfully in almost all my Remix apps.
I appreciate any feedback if rejected and willing to make any modifications requested. ;)
I've chosen a gradient from
bg-blue-brand
tobg-aqua-brand
I think works good on both dark and light modes.Preview: