From 98efe02a2a4a41227dac4a2dda40c6258bcb6c3c Mon Sep 17 00:00:00 2001 From: CanisMinor Date: Tue, 17 Oct 2023 16:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20Fix=20lazyload=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/features/SessionListContent/List/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/chat/features/SessionListContent/List/index.tsx b/src/app/chat/features/SessionListContent/List/index.tsx index ed1b6085378f..495c3a09d894 100644 --- a/src/app/chat/features/SessionListContent/List/index.tsx +++ b/src/app/chat/features/SessionListContent/List/index.tsx @@ -1,4 +1,4 @@ -import { useResponsive } from 'antd-style'; +import { createStyles, useResponsive } from 'antd-style'; import isEqual from 'fast-deep-equal'; import Link from 'next/link'; import { memo } from 'react'; @@ -12,10 +12,16 @@ import AddButton from './AddButton'; import SessionItem from './Item'; import SkeletonList from './SkeletonList'; +const useStyles = createStyles( + ({ css }) => css` + min-height: 70px; + `, +); + const SessionList = memo(() => { const list = useSessionStore(sessionSelectors.sessionList, isEqual); const [activeSession, switchSession] = useSessionStore((s) => [s.activeSession, s.switchSession]); - + const { styles } = useStyles(); const isInit = useSessionHydrated(); const { mobile } = useResponsive(); @@ -24,7 +30,7 @@ const SessionList = memo(() => { ) : list.length > 0 ? ( list.map(({ id }) => ( - +