-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nprogress): add nprogress package
- Loading branch information
1 parent
aaef18f
commit dc56e28
Showing
8 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Link} from "react-router-dom"; | ||
|
||
const Logo = () => { | ||
|
||
return (<> | ||
<Link to={"/"}> | ||
<img src="/images/favicon.svg" alt="salam logo" className={"w-[40px] absolute top-[5px] right-[7px]"}/> | ||
</Link> | ||
</>) | ||
} | ||
|
||
export default Logo; |
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,22 @@ | ||
import { useEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import NProgress from 'nprogress'; | ||
import 'nprogress/nprogress.css'; | ||
|
||
const RouteChangeHandler = () => { | ||
const location = useLocation(); | ||
|
||
useEffect(() => { | ||
NProgress.start(); | ||
|
||
const timer = setTimeout(() => { | ||
NProgress.done(); | ||
}, 300); | ||
|
||
return () => clearTimeout(timer); | ||
}, [location]); | ||
|
||
return null; | ||
}; | ||
|
||
export default RouteChangeHandler; |
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