Skip to content

Commit

Permalink
remove AutoSizer
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Apr 18, 2023
1 parent 2c9d730 commit 1b959dc
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions src/renderer/components/dialogs/ViewGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { selectChat } from '../helpers/ChatMethods'
import { useThemeCssVar } from '../../ThemeManager'
import { ContactList2, useContactsMap } from '../contact/ContactList'
import { useLogicVirtualChatList, ChatListPart } from '../chat/ChatList'
import AutoSizer from 'react-virtualized-auto-sizer'
import {
PseudoListItemShowQrCode,
PseudoListItemAddMember,
Expand Down Expand Up @@ -276,33 +275,33 @@ function ViewGroupInner(props: {
</div>
<div className='group-separator'>
{tx('profile_shared_chats')}
</div>
<div style={{height: CHATLISTITEM_CHAT_HEIGHT * chatListIds.length}}>
<AutoSizer>
{({ width, height }) => (
<ChatListPart
isRowLoaded={isChatLoaded}
loadMoreRows={loadChats}
rowCount={chatListIds.length}
width={width}
height={height}
itemKey={index => 'key' + chatListIds[index]}
itemHeight={CHATLISTITEM_CHAT_HEIGHT}
>
{({ index, style }) => {
const [chatId] = chatListIds[index]
return (
<div style={style}>
<ChatListItem
chatListItem={chatCache[chatId] || undefined}
onClick={onChatClick.bind(null, chatId)}
/>
</div>
)
}}
</ChatListPart>
)}
</AutoSizer>
</div>
<div
style={{
height: CHATLISTITEM_CHAT_HEIGHT * chatListIds.length,
}}
>
<ChatListPart
isRowLoaded={isChatLoaded}
loadMoreRows={loadChats}
rowCount={chatListIds.length}
width={'500px'}
height={CHATLISTITEM_CHAT_HEIGHT * chatListIds.length}
itemKey={index => 'key' + chatListIds[index]}
itemHeight={CHATLISTITEM_CHAT_HEIGHT}
>
{({ index, style }) => {
const [chatId] = chatListIds[index]
return (
<div style={style}>
<ChatListItem
chatListItem={chatCache[chatId] || undefined}
onClick={onChatClick.bind(null, chatId)}
/>
</div>
)
}}
</ChatListPart>
</div>
<div className='group-separator'>
{!isBroadcast
Expand Down

0 comments on commit 1b959dc

Please sign in to comment.