sforkowany z mirror/soapbox
Fix fade when scrolling on ChatList
rodzic
c40651150c
commit
1a124c2eab
|
@ -110,6 +110,7 @@ const ChatListItem: React.FC<IChatListItemInterface> = ({ chat, chatSilence, onC
|
||||||
|
|
||||||
<HStack alignItems='center' space={2}>
|
<HStack alignItems='center' space={2}>
|
||||||
<div className='text-gray-600 hidden group-hover:block hover:text-gray-100'>
|
<div className='text-gray-600 hidden group-hover:block hover:text-gray-100'>
|
||||||
|
{/* TODO: fix nested buttons here */}
|
||||||
<DropdownMenuContainer
|
<DropdownMenuContainer
|
||||||
items={menu}
|
items={menu}
|
||||||
src={require('@tabler/icons/dots.svg')}
|
src={require('@tabler/icons/dots.svg')}
|
||||||
|
|
|
@ -14,11 +14,10 @@ import ChatListItem from './chat-list-item';
|
||||||
interface IChatList {
|
interface IChatList {
|
||||||
onClickChat: (chat: any) => void,
|
onClickChat: (chat: any) => void,
|
||||||
useWindowScroll?: boolean,
|
useWindowScroll?: boolean,
|
||||||
fade?: boolean,
|
|
||||||
searchValue?: string
|
searchValue?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const ChatList: React.FC<IChatList> = ({ onClickChat, useWindowScroll = false, searchValue, fade }) => {
|
const ChatList: React.FC<IChatList> = ({ onClickChat, useWindowScroll = false, searchValue }) => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const chatListRef = useRef(null);
|
const chatListRef = useRef(null);
|
||||||
|
@ -76,22 +75,20 @@ const ChatList: React.FC<IChatList> = ({ onClickChat, useWindowScroll = false, s
|
||||||
)}
|
)}
|
||||||
</PullToRefresh>
|
</PullToRefresh>
|
||||||
|
|
||||||
{fade && (
|
<>
|
||||||
<>
|
<div
|
||||||
<div
|
className={classNames('inset-x-0 top-0 flex rounded-t-lg justify-center bg-gradient-to-b from-white to-transparent pb-12 pt-8 pointer-events-none dark:from-gray-900 absolute transition-opacity duration-500', {
|
||||||
className={classNames('inset-x-0 top-0 flex rounded-t-lg justify-center bg-gradient-to-b from-white pb-12 pt-8 pointer-events-none dark:from-gray-900 absolute transition-opacity duration-500', {
|
'opacity-0': isNearTop,
|
||||||
'opacity-0': isNearTop,
|
'opacity-100': !isNearTop,
|
||||||
'opacity-100': !isNearTop,
|
})}
|
||||||
})}
|
/>
|
||||||
/>
|
<div
|
||||||
<div
|
className={classNames('inset-x-0 bottom-0 flex rounded-b-lg justify-center bg-gradient-to-t from-white to-transparent pt-12 pb-8 pointer-events-none dark:from-gray-900 absolute transition-opacity duration-500', {
|
||||||
className={classNames('inset-x-0 bottom-0 flex rounded-b-lg justify-center bg-gradient-to-t from-white pt-12 pb-8 pointer-events-none dark:from-gray-900 absolute transition-opacity duration-500', {
|
'opacity-0': isNearBottom,
|
||||||
'opacity-0': isNearBottom,
|
'opacity-100': !isNearBottom,
|
||||||
'opacity-100': !isNearBottom,
|
})}
|
||||||
})}
|
/>
|
||||||
/>
|
</>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,7 +59,6 @@ const ChatPane = () => {
|
||||||
<ChatList
|
<ChatList
|
||||||
searchValue={debouncedValue}
|
searchValue={debouncedValue}
|
||||||
onClickChat={handleClickChat}
|
onClickChat={handleClickChat}
|
||||||
fade
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<EmptyResultsBlankslate />
|
<EmptyResultsBlankslate />
|
||||||
|
|
Ładowanie…
Reference in New Issue