|
|
|
|
@ -198,7 +198,7 @@ export function DiscussionList({ total = 10, discussions = [], loadMoreItems, lo |
|
|
|
|
/>, [onClick, showRealNames, userId]); |
|
|
|
|
|
|
|
|
|
const isItemLoaded = useCallback((index) => index < discussionsRef.current.length, []); |
|
|
|
|
const { ref, contentBoxSize: { inlineSize = 378, blockSize = 750 } = {} } = useResizeObserver(); |
|
|
|
|
const { ref, contentBoxSize: { inlineSize = 378, blockSize = 750 } = {} } = useResizeObserver({ debounceDelay: 100 }); |
|
|
|
|
|
|
|
|
|
return <VerticalBar> |
|
|
|
|
<VerticalBar.Header> |
|
|
|
|
@ -210,10 +210,10 @@ export function DiscussionList({ total = 10, discussions = [], loadMoreItems, lo |
|
|
|
|
<Box display='flex' flexDirection='row' p='x24' borderBlockEndWidth='x2' borderBlockEndStyle='solid' borderBlockEndColor='neutral-200' flexShrink={0}> |
|
|
|
|
<TextInput placeholder={t('Search_Messages')} value={text} onChange={setText} addon={<Icon name='magnifier' size='x20'/>}/> |
|
|
|
|
</Box> |
|
|
|
|
<Box flexGrow={1} flexShrink={1} ref={ref}> |
|
|
|
|
<Box flexGrow={1} flexShrink={1} ref={ref} overflow='hidden'> |
|
|
|
|
{error && <Callout mi='x24' type='danger'>{error.toString()}</Callout>} |
|
|
|
|
{total === 0 && <Box p='x24'>{t('No_Discussions_found')}</Box>} |
|
|
|
|
<InfiniteLoader |
|
|
|
|
{!error && total > 0 && <InfiniteLoader |
|
|
|
|
isItemLoaded={isItemLoaded} |
|
|
|
|
itemCount={total} |
|
|
|
|
loadMoreItems={ loading ? () => {} : loadMoreItems} |
|
|
|
|
@ -229,7 +229,7 @@ export function DiscussionList({ total = 10, discussions = [], loadMoreItems, lo |
|
|
|
|
onItemsRendered={onItemsRendered} |
|
|
|
|
>{rowRenderer}</List> |
|
|
|
|
)} |
|
|
|
|
</InfiniteLoader> |
|
|
|
|
</InfiniteLoader>} |
|
|
|
|
</Box> |
|
|
|
|
</VerticalBar.Content> |
|
|
|
|
</VerticalBar>; |
|
|
|
|
|