Skip to content

Commit

Permalink
Care Loading icon in organization and facility users
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishith25 committed Jan 4, 2025
1 parent 68c4c3d commit d71b047
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Facility/FacilityUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import useTanStackQueryInstead from "@/Utils/request/useQuery";

import Loading from "../Common/Loading";

export default function FacilityUsers(props: { facilityId: number }) {
const { t } = useTranslation();
const { qParams, updateQuery, Pagination } = useFilters({
Expand Down Expand Up @@ -41,7 +43,7 @@ export default function FacilityUsers(props: { facilityId: number }) {
});

if (userListLoading) {
return <div>Loading...</div>;
return <Loading />;
}
if (!userListData) {
return <div>No users found</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "@/components/ui/breadcrumb";
import { Menubar, MenubarMenu, MenubarTrigger } from "@/components/ui/menubar";

import Loading from "@/components/Common/Loading";
import Page from "@/components/Common/Page";

import routes from "@/Utils/request/api";
Expand Down Expand Up @@ -61,7 +62,7 @@ export default function FacilityOrganizationLayout({
});

if (isLoading) {
return <div>Loading...</div>;
return <Loading />;
}
// add loading state
if (!org) {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Organization/components/OrganizationLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "@/components/ui/breadcrumb";
import { Menubar, MenubarMenu, MenubarTrigger } from "@/components/ui/menubar";

import Loading from "@/components/Common/Loading";
import Page from "@/components/Common/Page";

import query from "@/Utils/request/query";
Expand Down Expand Up @@ -76,7 +77,7 @@ export default function OrganizationLayout({
});

if (isLoading) {
return <div>Loading...</div>;
return <Loading />;
}
// add loading state
if (!org) {
Expand Down

0 comments on commit d71b047

Please sign in to comment.