Skip to content

Commit

Permalink
feat: Suspense 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lurgi committed Oct 11, 2024
1 parent 5fc7bde commit 4b46aa4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions frontend/src/pages/DashboardLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useState } from 'react';
import { Suspense, useState } from 'react';

import DashboardSidebar from '@components/dashboard/DashboardSidebar';
import LoadingPage from '@pages/LoadingPage';

import useGetDashboards from '@hooks/useGetDashboards';
import useElementRect from '@hooks/useElementRect';

Expand Down Expand Up @@ -36,12 +38,14 @@ export default function DashboardLayout() {
/>
</S.Sidebar>

<S.MainContainer
isSidebarOpen={isSidebarOpen}
sidebarWidth={rect?.width}
>
<Outlet />
</S.MainContainer>
<Suspense fallback={<LoadingPage />}>
<S.MainContainer
isSidebarOpen={isSidebarOpen}
sidebarWidth={rect?.width}
>
<Outlet />
</S.MainContainer>
</Suspense>
</S.Layout>
);
}

0 comments on commit 4b46aa4

Please sign in to comment.