Skip to content

Commit

Permalink
Updated Skeleton Progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
GradleD committed Nov 7, 2024
1 parent 3d21cbb commit e34ab90
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/skeletons/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface LoadingWrapperProps {
children: React.ReactNode;
width?: string | number;
height?: string | number;
skeletonTextWidth?: string | number;
}

const Loading: React.FC<LoadingWrapperProps> = ({
Expand All @@ -18,6 +19,7 @@ const Loading: React.FC<LoadingWrapperProps> = ({
children,
width = "100%",
height = 100,
skeletonTextWidth = 80,
}) => {
if (!isLoading) return <>{children}</>;
switch (loadingType) {
Expand All @@ -29,6 +31,7 @@ const Loading: React.FC<LoadingWrapperProps> = ({
variant="rectangular"
width="100%"
height="100%"
aria-busy="true"
/>
<div style={{
position: 'absolute',
Expand All @@ -38,15 +41,15 @@ const Loading: React.FC<LoadingWrapperProps> = ({
display: 'flex',
alignItems: 'center'
}}>
<Lock sx={{ marginRight: 1 }} /> {/* Privacy Icon */}
<Skeleton variant="text" width={80} />
<Lock sx={{ marginRight: 1 }} aria-hidden="true" /> {/* Privacy Icon */}
<Skeleton variant="text" width={skeletonTextWidth} />
</div>
</div>
);
case "spinner":
return (
<div className="flex justify-center items-center w-full h-[350px]">
<CircularProgress />
<CircularProgress aria-busy="true"/>
</div>
);
default:
Expand Down

0 comments on commit e34ab90

Please sign in to comment.