Skip to content

Commit

Permalink
💄 style: Fix lazyload height
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 authored Oct 17, 2023
1 parent dd8d47c commit 98efe02
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/chat/features/SessionListContent/List/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand All @@ -24,7 +30,7 @@ const SessionList = memo(() => {
<SkeletonList />
) : list.length > 0 ? (
list.map(({ id }) => (
<LazyLoad height={70} key={id}>
<LazyLoad className={styles} key={id}>
<Link
aria-label={id}
href={SESSION_CHAT_URL(id, mobile)}
Expand Down

0 comments on commit 98efe02

Please sign in to comment.