generated from Blazity/next-enterprise
-
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.
- Loading branch information
1 parent
28affa3
commit 0bcb86c
Showing
5 changed files
with
37 additions
and
50 deletions.
There are no files selected for viewing
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use client" | ||
import React, { use, useEffect, useState } from "react" | ||
import Spinner from "components/Spinner" | ||
import { usePathname } from "next/navigation" | ||
|
||
export const ReportLoadingShade: React.FC<{loading:any}> = ({ loading }) => { | ||
const pathname = usePathname() | ||
const [isLoading, setIsLoading] = useState(false) | ||
|
||
useEffect(() => setIsLoading(false), [pathname]) | ||
useEffect(() => setIsLoading(true), [loading]) | ||
|
||
if (!isLoading) return null | ||
|
||
return ( | ||
<div className="fixed left-0 top-0 z-50 flex h-full w-full flex-col items-center justify-center gap-4 bg-white/75"> | ||
<Spinner /> | ||
<h3 className="text-4xl">Report is loading...</h3> | ||
</div> | ||
) | ||
} |
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,5 @@ | ||
import { | ||
ReportLoadingShade | ||
} from "./ReportLoadingShade" | ||
|
||
export default ReportLoadingShade |