From 15747f86dd78ac9d64dc8ef6271f98b7235242a9 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 9 Jan 2023 00:53:28 -0800 Subject: [PATCH] Lazy load followers components --- web/components/ui/Content/Content.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx index 81bb1a30b..e9d5615c8 100644 --- a/web/components/ui/Content/Content.tsx +++ b/web/components/ui/Content/Content.tsx @@ -33,16 +33,22 @@ import { ContentHeader } from '../../common/ContentHeader/ContentHeader'; import { ServerStatus } from '../../../interfaces/server-status.model'; import { Statusbar } from '../Statusbar/Statusbar'; import { ChatMessage } from '../../../interfaces/chat-message.model'; -import { FollowerCollection } from '../followers/FollowerCollection/FollowerCollection'; import { ExternalAction } from '../../../interfaces/external-action'; import { Modal } from '../Modal/Modal'; import { ActionButtonMenu } from '../../action-buttons/ActionButtonMenu/ActionButtonMenu'; -import { FollowModal } from '../../modals/FollowModal/FollowModal'; const { Content: AntContent } = Layout; // Lazy loaded components +const FollowerCollection = dynamic(() => + import('../followers/FollowerCollection/FollowerCollection').then(mod => mod.FollowerCollection), +); + +const FollowModal = dynamic(() => + import('../../modals/FollowModal/FollowModal').then(mod => mod.FollowModal), +); + const BrowserNotifyModal = dynamic(() => import('../../modals/BrowserNotifyModal/BrowserNotifyModal').then(mod => mod.BrowserNotifyModal), );