Skip to content

Commit

Permalink
⚡️ perf: improve auth page performance (lobehub#5287)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Jan 4, 2025
1 parent 3973249 commit 932114e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/app/(main)/profile/@category/default.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { Suspense } from 'react';

import SkeletonLoading from '@/components/Loading/SkeletonLoading';

import CategoryContent from './features/CategoryContent';

const Category = () => {
return <CategoryContent />;
return (
<Suspense fallback={<SkeletonLoading paragraph={{ rows: 7 }} title={false} />}>
<CategoryContent />
</Suspense>
);
};

Category.displayName = 'SettingCategory';
Expand Down
4 changes: 3 additions & 1 deletion src/app/(main)/profile/_layout/Desktop/SideBar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use client';

import { createStyles } from 'antd-style';
import { Suspense } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox, FlexboxProps } from 'react-layout-kit';

import BrandWatermark from '@/components/BrandWatermark';
import CircleLoading from '@/components/Loading/CircleLoading';
import PanelTitle from '@/components/PanelTitle';

const useStyles = createStyles(({ token, css }) => ({
Expand Down Expand Up @@ -33,7 +35,7 @@ const SidebarLayout = ({ children, className, title, desc, ...rest }: SidebarLay
{...rest}
>
<PanelTitle desc={desc || t('header.desc')} title={title || t('header.title')} />
{children}
<Suspense fallback={<CircleLoading />}>{children}</Suspense>
<BrandWatermark paddingInline={12} />
</Flexbox>
);
Expand Down

0 comments on commit 932114e

Please sign in to comment.