From 24adddd29ff84e75738beeea3d52003dafa969c4 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:08:14 +0530 Subject: [PATCH] [WEB-1647] chore: breadcrumb items loader (#4887) * chore: breadcrumb item loader added * chore: breadcrumb item loader implementation --- packages/ui/src/breadcrumbs/breadcrumbs.tsx | 16 +++++++++++++--- .../(detail)/[projectId]/archives/header.tsx | 4 ++-- .../archives/issues/(detail)/header.tsx | 4 ++-- .../[projectId]/cycles/(detail)/header.tsx | 16 +++++++++++----- .../[projectId]/cycles/(list)/header.tsx | 4 ++-- .../(detail)/[projectId]/draft-issues/header.tsx | 11 ++++++++--- .../(detail)/[projectId]/inbox/header.tsx | 4 ++-- .../[projectId]/issues/(detail)/header.tsx | 4 ++-- .../[projectId]/issues/(list)/header.tsx | 14 ++++++++++---- .../[projectId]/modules/(detail)/header.tsx | 16 +++++++++++----- .../[projectId]/modules/(list)/header.tsx | 4 ++-- .../[projectId]/pages/(detail)/header.tsx | 4 ++-- .../(detail)/[projectId]/pages/(list)/header.tsx | 4 ++-- .../(detail)/[projectId]/settings/header.tsx | 4 ++-- .../views/(detail)/[viewId]/header.tsx | 11 ++++++++--- .../(detail)/[projectId]/views/(list)/header.tsx | 4 ++-- .../(projects)/settings/header.tsx | 4 ++-- 17 files changed, 83 insertions(+), 45 deletions(-) diff --git a/packages/ui/src/breadcrumbs/breadcrumbs.tsx b/packages/ui/src/breadcrumbs/breadcrumbs.tsx index 253e8308e..031825691 100644 --- a/packages/ui/src/breadcrumbs/breadcrumbs.tsx +++ b/packages/ui/src/breadcrumbs/breadcrumbs.tsx @@ -4,9 +4,10 @@ import { ChevronRight } from "lucide-react"; type BreadcrumbsProps = { children: React.ReactNode; onBack?: () => void; + isLoading?: boolean; }; -const Breadcrumbs = ({ children, onBack }: BreadcrumbsProps) => { +const Breadcrumbs = ({ children, onBack, isLoading = false }: BreadcrumbsProps) => { const [isSmallScreen, setIsSmallScreen] = React.useState(false); React.useEffect(() => { @@ -21,6 +22,13 @@ const Breadcrumbs = ({ children, onBack }: BreadcrumbsProps) => { const childrenArray = React.Children.toArray(children); + const BreadcrumbItemLoader = ( +
+ + +
+ ); + return (
{!isSmallScreen && ( @@ -33,7 +41,7 @@ const Breadcrumbs = ({ children, onBack }: BreadcrumbsProps) => {
)}
0 ? "hidden sm:flex" : "flex"}`}> - {child} + {isLoading ? BreadcrumbItemLoader : child}
))} @@ -50,7 +58,9 @@ const Breadcrumbs = ({ children, onBack }: BreadcrumbsProps) => { )}