Creating Skeleton in Image_Gallery. #415

Closed
kartik.sharma wants to merge 17 commits from Image_Gallery_filter into Organization_Management
2 changed files with 62 additions and 10 deletions
Showing only changes of commit 40fb010128 - Show all commits

View File

@ -0,0 +1,46 @@
import React from "react";
const ImageCardSkeleton = ({ count = 1 }) => {
const cards = Array.from({ length: count });
return (
<div className="row g-3">
{cards.map((_, idx) => (
<div key={idx} className="col-12">
<div className="card p-3">
<div className="d-flex align-items-center mb-2">
<div
className="rounded-circle bg-light placeholder"
style={{ width: "40px", height: "40px" }}
/>
<div className="ms-2 flex-grow-1">
<h6 className="placeholder-glow mb-1">
<span className="placeholder col-6 bg-light"></span>
</h6>
<small className="placeholder-glow">
<span className="placeholder col-4 bg-light"></span>
</small>
</div>
</div>
<div
className="bg-light placeholder mb-2"
style={{ width: "100%", height: "150px", borderRadius: "4px" }}
/>
<div className="d-flex justify-content-between align-items-center">
<div className="placeholder-glow">
<span className="placeholder col-4 bg-light"></span>
</div>
<div className="placeholder-glow">
<span className="placeholder col-2 bg-light"></span>
</div>
</div>
</div>
</div>
))}
</div>
);
};
export default ImageCardSkeleton;

View File

@ -12,6 +12,7 @@ import ImageGalleryListView from "../../components/ImageGallery/ImageGalleryList
import ImageGalleryFilters from "../../components/ImageGallery/ImageGalleryFilters";
import "../../components/ImageGallery/ImageGallery.css";
import { useFab } from "../../Context/FabContext";
import ImageGallerySkeleton from "../../components/Charts/ImageGallerySkeleton";
const ImageGalleryPage = () => {
const dispatch = useDispatch();
@ -246,6 +247,9 @@ const ImageGalleryPage = () => {
)}
{isLoading ? (
<ImageGallerySkeleton count={4} />
) : (
<ImageGalleryListView
images={images}
isLoading={isLoading}
@ -256,6 +260,8 @@ const ImageGalleryPage = () => {
formatUTCToLocalTime={formatUTCToLocalTime}
moment={moment}
/>
)}
</div>
);
};