change position new message

This commit is contained in:
PhilReact 2024-11-14 07:08:19 +02:00
parent ff4c4bb8d8
commit 108bbbe23f

View File

@ -118,7 +118,10 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
}); });
return ( return (
<> <div style={{
height: '100%',
position: 'relative'
}}>
<div ref={parentRef} style={{ height: '100%', overflow: 'auto', position: 'relative', display: 'flex' }}> <div ref={parentRef} style={{ height: '100%', overflow: 'auto', position: 'relative', display: 'flex' }}>
<div <div
style={{ style={{
@ -203,14 +206,14 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
})} })}
</div> </div>
</div> </div>
{showScrollButton && ( {showScrollButton && (
<button <button
onClick={() => scrollToBottom()} onClick={() => scrollToBottom()}
style={{ style={{
bottom: 20,
position: 'absolute', position: 'absolute',
bottom: 20,
right: 20, right: 20,
backgroundColor: '#ff5a5f', backgroundColor: '#ff5a5f',
color: 'white', color: 'white',
@ -223,7 +226,7 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
Scroll to Unread Messages Scroll to Unread Messages
</button> </button>
)} )}
</> </div>
); );
}; };