-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e09567
commit 2fc6211
Showing
6 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
apps/web-remix/app/components/progressBar/PageProgress.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { useEffect } from "react"; | ||
import { useNavigation } from "@remix-run/react"; | ||
import NProgress from "nprogress"; | ||
import "nprogress/nprogress.css"; | ||
import "./pageProgress.css"; | ||
|
||
NProgress.configure({ showSpinner: false }); | ||
|
||
export const PageProgress: React.FC = () => { | ||
const { state } = useNavigation(); | ||
|
||
useEffect(() => { | ||
if (state === "loading") NProgress.start(); | ||
if (state === "idle") NProgress.done(); | ||
}, [state]); | ||
|
||
return null; | ||
}; |
11 changes: 11 additions & 0 deletions
11
apps/web-remix/app/components/progressBar/pageProgress.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#nprogress .bar{ | ||
@apply !bg-primary-500 !h-[1.5px] | ||
} | ||
|
||
#nprogress .spinner-icon{ | ||
@apply !border-t-primary-600 !border-l-primary-600 | ||
} | ||
|
||
#nprogress .peg{ | ||
@apply !shadow-xl !shadow-primary-500 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.