Merge pull request #135 from arc53/feature/more-ux-1

Feature/more ux 1
This commit is contained in:
Alex 2023-02-27 10:50:43 +00:00 committed by GitHub
commit b5cb3f994b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,8 +19,9 @@ export default function Conversation() {
const endMessageRef = useRef<HTMLDivElement>(null); const endMessageRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLDivElement>(null); const inputRef = useRef<HTMLDivElement>(null);
useEffect(() => useEffect(
endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }), () => endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }),
[messages],
); );
const handleQuestion = (question: string) => { const handleQuestion = (question: string) => {
@ -35,7 +36,7 @@ export default function Conversation() {
return ( return (
<ConversationBubble <ConversationBubble
ref={index === messages.length - 1 ? endMessageRef : null} ref={index === messages.length - 1 ? endMessageRef : null}
className={`${index === messages.length - 1 ? 'mb-20' : 'mb-7'}`} className={`${index === messages.length - 1 ? 'mb-24' : 'mb-7'}`}
key={index} key={index}
message={message.text} message={message.text}
type={message.type} type={message.type}