front and backend logic for model switching

This commit is contained in:
Daniel Avila 2023-02-13 21:15:28 -05:00
parent a5afd5c48f
commit c00a2c902b
9 changed files with 58 additions and 39 deletions

View file

@ -1,7 +1,7 @@
import React, { useEffect, useState, useRef } from 'react';
import Message from './Message';
import ScrollToBottom from './ScrollToBottom';
import { CSSTransition } from 'react-transition-group';
import ScrollToBottom from './ScrollToBottom';
import Message from './Message';
const Messages = ({ messages }) => {
const [showScrollButton, setShowScrollButton] = useState(false);
@ -13,7 +13,7 @@ const Messages = ({ messages }) => {
const scrollable = scrollableRef.current;
const hasScrollbar = scrollable.scrollHeight > scrollable.clientHeight;
setShowScrollButton(hasScrollbar);
}, 850);
}, 650);
return () => {
clearTimeout(timeoutId);
@ -69,7 +69,7 @@ const Messages = ({ messages }) => {
))}
<CSSTransition
in={showScrollButton}
timeout={650}
timeout={400}
classNames="scroll-down"
unmountOnExit={false}
appear