-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suspense fallback screen, refresh page when org changed
- Loading branch information
Showing
4 changed files
with
83 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { cn } from "@/lib/utils"; | ||
import { DetailedHTMLProps, HTMLAttributes } from "react"; | ||
|
||
interface LoadingProps { | ||
size: "sm" | "md" | "lg" | "xl"; | ||
} | ||
|
||
export function Loading( | ||
props: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & | ||
LoadingProps, | ||
) { | ||
const sizeCN = cn({ | ||
"text-sm": props.size === "sm", | ||
"text-lg": props.size === "md", | ||
"text-2xl": props.size === "lg", | ||
"text-4xl": props.size === "xl", | ||
}); | ||
|
||
return ( | ||
<div | ||
{...props} | ||
className={cn( | ||
"flex w-full h-full justify-center items-center", | ||
props.className, | ||
)} | ||
> | ||
<div className={cn("i-lucide:loader-2 animate-spin", sizeCN)} /> | ||
</div> | ||
); | ||
} | ||
|
||
export function GlobalLoading () { | ||
|
||
return ( | ||
<div className="fixed top-0 left-0 w-full h-full"> | ||
<Loading size='xl' /> | ||
</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
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