Skip to content

Commit

Permalink
refactor: lazy load org-details page
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshift committed Apr 5, 2024
1 parent 5301b32 commit 0ca3838
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/orgs/pages/org-params-page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use client';

import dynamic from 'next/dynamic';

import { ROUTE_TABS } from '~/shared/core/constants';

import { useOrgDetails } from '~/orgs/hooks/use-org-details';
import { OrgDetailsCard } from '~/orgs/components/org-details-card';
import { OrgReviews } from '~/orgs/components/org-reviews';
import { OtherJobCards } from '~/orgs/components/other-job-cards';
import { ProjectDetailsCards } from '~/projects/components/project-details-cards';

interface Props {
params: {
Expand All @@ -28,3 +26,21 @@ export const OrgParamsPage = ({ params: { id, tab } }: Props) => {

return null;
};

const OrgDetailsCard = dynamic(() =>
import('~/orgs/components/org-details-card').then((m) => m.OrgDetailsCard),
);

const ProjectDetailsCards = dynamic(() =>
import('~/projects/components/project-details-cards').then(
(m) => m.ProjectDetailsCards,
),
);

const OtherJobCards = dynamic(() =>
import('~/orgs/components/other-job-cards').then((m) => m.OtherJobCards),
);

const OrgReviews = dynamic(() =>
import('~/orgs/components/org-reviews').then((m) => m.OrgReviews),
);

0 comments on commit 0ca3838

Please sign in to comment.