From 50db71843bb81522693f367c47ab6dcb6ae84e2a Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Mon, 13 Apr 2026 08:07:43 +0330 Subject: [PATCH] refactor(Loading): update Loading component import paths - Changed import paths for the Loading component from "@/app/loading" to "@/components/loading" across multiple files to maintain consistency and improve modularity. - Removed the Loading component definition from loading.tsx, simplifying the file structure. --- .../companies/details/[id]/page.tsx | 2 +- .../(companies)/companies/edit/[id]/page.tsx | 2 +- .../company-categories/edit/[id]/page.tsx | 2 +- .../notification-history/[id]/page.tsx | 2 +- src/app/admins/edit/[id]/page.tsx | 2 +- src/app/customers/edit/[id]/page.tsx | 2 +- src/app/loading.tsx | 14 +---------- src/app/marketing/edit/[id]/page.tsx | 2 +- src/app/pages/settings/page.tsx | 2 +- src/app/tenders/[details]/page.tsx | 2 +- src/components/Layouts/conditional-layout.tsx | 4 ++-- src/components/Layouts/header/index.tsx | 2 +- .../header/notification/notification-list.tsx | 7 ++++-- src/components/Layouts/sidebar/index.tsx | 2 +- src/components/loading.tsx | 23 +++++++++++++++++++ src/contexts/Auth-guard.ctx.tsx | 4 ++-- src/contexts/Login-guard.ctx.tsx | 4 ++-- 17 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 src/components/loading.tsx diff --git a/src/app/(companies)/companies/details/[id]/page.tsx b/src/app/(companies)/companies/details/[id]/page.tsx index 072a6b4..67a77f8 100644 --- a/src/app/(companies)/companies/details/[id]/page.tsx +++ b/src/app/(companies)/companies/details/[id]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import { ShowcaseSection } from "@/components/Layouts/showcase-section"; import IsVisible from "@/components/ui/IsVisible"; diff --git a/src/app/(companies)/companies/edit/[id]/page.tsx b/src/app/(companies)/companies/edit/[id]/page.tsx index d078789..63eb476 100644 --- a/src/app/(companies)/companies/edit/[id]/page.tsx +++ b/src/app/(companies)/companies/edit/[id]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import CreateCompany from "@/components/forms/companies/CreateCompany"; diff --git a/src/app/(companies)/company-categories/edit/[id]/page.tsx b/src/app/(companies)/company-categories/edit/[id]/page.tsx index fa76295..8f228ce 100644 --- a/src/app/(companies)/company-categories/edit/[id]/page.tsx +++ b/src/app/(companies)/company-categories/edit/[id]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import CreateCompanyCategoryForm from "@/components/forms/companies/company-categories/CreateCompanyCategory"; import { useCompanyCategoriesDetails } from "@/hooks/queries"; diff --git a/src/app/(notifications)/notification-history/[id]/page.tsx b/src/app/(notifications)/notification-history/[id]/page.tsx index 2cdaa3c..708de6b 100644 --- a/src/app/(notifications)/notification-history/[id]/page.tsx +++ b/src/app/(notifications)/notification-history/[id]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import { NotificationDetailsCard } from "@/components/ui/notification-details-card"; import { useGetNotificationDetails } from "@/hooks/queries/useNotificationQueries"; diff --git a/src/app/admins/edit/[id]/page.tsx b/src/app/admins/edit/[id]/page.tsx index aff5517..6864d6f 100644 --- a/src/app/admins/edit/[id]/page.tsx +++ b/src/app/admins/edit/[id]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import CreateAdminForm from "@/components/forms/admins/CreateAdmin"; import { useAdminDetails } from "@/hooks/queries"; diff --git a/src/app/customers/edit/[id]/page.tsx b/src/app/customers/edit/[id]/page.tsx index 7fdd6bf..2a11756 100644 --- a/src/app/customers/edit/[id]/page.tsx +++ b/src/app/customers/edit/[id]/page.tsx @@ -7,7 +7,7 @@ import { } from "@/hooks/queries/useCustomerQueries"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import CreateCustomer from "@/components/forms/customers/CreateCustomer"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; const EditCustomer = ({ params }: { params: Promise<{ id: string }> }) => { const { id } = use(params); diff --git a/src/app/loading.tsx b/src/app/loading.tsx index 7979c4a..20b7e6d 100644 --- a/src/app/loading.tsx +++ b/src/app/loading.tsx @@ -1,15 +1,3 @@ -import { cn } from "../lib/utils"; - -interface IProps { - className?: string | null; -} - -const Loading = ({ className = "w-svw h-svh" }: IProps) => { - return ( -
-
-
- ); -}; +import Loading from "@/components/loading"; export default Loading; diff --git a/src/app/marketing/edit/[id]/page.tsx b/src/app/marketing/edit/[id]/page.tsx index d1288e0..e363f06 100644 --- a/src/app/marketing/edit/[id]/page.tsx +++ b/src/app/marketing/edit/[id]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import { useGetCmsDetails, useUpdateCms } from "@/hooks/queries/useCmsQueries"; import { BreadcrumbItem } from "@/types/shared"; import { use } from "react"; diff --git a/src/app/pages/settings/page.tsx b/src/app/pages/settings/page.tsx index d54a818..35d0cc5 100644 --- a/src/app/pages/settings/page.tsx +++ b/src/app/pages/settings/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import InputGroup from "@/components/FormElements/InputGroup"; import { Select } from "@/components/FormElements/select"; import { ShowcaseSection } from "@/components/Layouts/showcase-section"; diff --git a/src/app/tenders/[details]/page.tsx b/src/app/tenders/[details]/page.tsx index b730785..2cd7f99 100644 --- a/src/app/tenders/[details]/page.tsx +++ b/src/app/tenders/[details]/page.tsx @@ -1,5 +1,5 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import { LocationIcon } from "@/assets/icons"; import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb"; import { ShowcaseSection } from "@/components/Layouts/showcase-section"; diff --git a/src/components/Layouts/conditional-layout.tsx b/src/components/Layouts/conditional-layout.tsx index eebb829..f88fb5c 100644 --- a/src/components/Layouts/conditional-layout.tsx +++ b/src/components/Layouts/conditional-layout.tsx @@ -16,9 +16,9 @@ function MainLayout({ children }: PropsWithChildren) { {/* Spacer to reserve space for collapsed sidebar on mobile - avoids reflow */} {isMobile &&
} -
+
-
+
{children}
diff --git a/src/components/Layouts/header/index.tsx b/src/components/Layouts/header/index.tsx index 2e565fa..af93a3c 100644 --- a/src/components/Layouts/header/index.tsx +++ b/src/components/Layouts/header/index.tsx @@ -6,7 +6,7 @@ import { UserInfo } from "./user-info"; export function Header() { return ( -
+

Opportunity Lens diff --git a/src/components/Layouts/header/notification/notification-list.tsx b/src/components/Layouts/header/notification/notification-list.tsx index 0006ac7..df988f6 100644 --- a/src/components/Layouts/header/notification/notification-list.tsx +++ b/src/components/Layouts/header/notification/notification-list.tsx @@ -1,6 +1,6 @@ "use client"; -import Loading from "@/app/loading"; +import Loading from "@/components/loading"; import IsVisible from "@/components/ui/IsVisible"; import { useGetMyNotifications } from "@/hooks/queries/useNotificationQueries"; import { TNotificationDetailsResponse } from "@/lib/api/types/NotificationHistory"; @@ -21,7 +21,10 @@ const NotificationList = ({ setUnreadNotificationCount(data?.data.length ?? 0); }, [data, isLoading]); - if (isLoading) return ; + if (isLoading) + return ( + + ); return (
    diff --git a/src/components/Layouts/sidebar/index.tsx b/src/components/Layouts/sidebar/index.tsx index b23de1f..553b01a 100644 --- a/src/components/Layouts/sidebar/index.tsx +++ b/src/components/Layouts/sidebar/index.tsx @@ -59,7 +59,7 @@ export function Sidebar() {