From 446f55af938d46c82e472a265210aca10248afd3 Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 18 Dec 2024 08:49:49 +0100 Subject: [PATCH] feat: implement dynamic imports for FileUpload components --- client/src/containers/profile/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/containers/profile/index.tsx b/client/src/containers/profile/index.tsx index b62ffbac..a9261707 100644 --- a/client/src/containers/profile/index.tsx +++ b/client/src/containers/profile/index.tsx @@ -2,6 +2,7 @@ import { useEffect, useMemo, useRef } from "react"; +import dynamic from "next/dynamic"; import Link from "next/link"; import { ExtractAtomValue, useSetAtom } from "jotai"; @@ -10,8 +11,7 @@ import { useFeatureFlags } from "@/hooks/use-feature-flags"; import CustomProjects from "@/containers/profile/custom-projects"; import DeleteAccount from "@/containers/profile/delete-account"; -import FileUpload, { TEMPLATE_FILES } from "@/containers/profile/file-upload"; -import FileUploadDescription from "@/containers/profile/file-upload/description"; +import { TEMPLATE_FILES } from "@/containers/profile/file-upload"; import ProfileSection from "@/containers/profile/profile-section"; import ProfileSidebar from "@/containers/profile/profile-sidebar"; import { profileStepAtom } from "@/containers/profile/store"; @@ -20,6 +20,11 @@ import UserDetails from "@/containers/profile/user-details"; import { ScrollArea } from "@/components/ui/scroll-area"; import { SidebarTrigger } from "@/components/ui/sidebar"; +const FileUpload = dynamic(() => import("@/containers/profile/file-upload")); +const FileUploadDescription = dynamic( + () => import("@/containers/profile/file-upload/description"), +); + export const PROFILE_SECTIONS = [ { id: "my-details",