Skip to content
Snippets Groups Projects
Unverified Commit 9f7b0c83 authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Fix prompt overlaying on chats (#288)

resolves #287
parent d509d7ed
No related branches found
No related tags found
No related merge requests found
...@@ -334,23 +334,23 @@ export default function DefaultChatContainer() { ...@@ -334,23 +334,23 @@ export default function DefaultChatContainer() {
{isMobile && <SidebarMobileHeader />} {isMobile && <SidebarMobileHeader />}
{fetchedMessages.length === 0 {fetchedMessages.length === 0
? mockMsgs.map((content, i) => { ? mockMsgs.map((content, i) => {
return <React.Fragment key={i}>{content}</React.Fragment>; return <React.Fragment key={i}>{content}</React.Fragment>;
}) })
: fetchedMessages.map((fetchedMessage, i) => { : fetchedMessages.map((fetchedMessage, i) => {
return ( return (
<React.Fragment key={i}> <React.Fragment key={i}>
<ChatBubble <ChatBubble
message={ message={
fetchedMessage.user === "" fetchedMessage.user === ""
? fetchedMessage.response ? fetchedMessage.response
: fetchedMessage.user : fetchedMessage.user
} }
type={fetchedMessage.user === "" ? "response" : "user"} type={fetchedMessage.user === "" ? "response" : "user"}
popMsg={popMsg} popMsg={popMsg}
/> />
</React.Fragment> </React.Fragment>
); );
})} })}
{showingNewWsModal && <NewWorkspaceModal hideModal={hideNewWsModal} />} {showingNewWsModal && <NewWorkspaceModal hideModal={hideNewWsModal} />}
</div> </div>
); );
......
...@@ -8,11 +8,16 @@ import { ...@@ -8,11 +8,16 @@ import {
AI_BACKGROUND_COLOR, AI_BACKGROUND_COLOR,
USER_BACKGROUND_COLOR, USER_BACKGROUND_COLOR,
} from "../../../../../utils/constants"; } from "../../../../../utils/constants";
import { v4 } from "uuid";
const HistoricalMessage = forwardRef( const HistoricalMessage = forwardRef(
({ message, role, workspace, sources = [], error = false }, ref) => { (
{ uuid = v4(), message, role, workspace, sources = [], error = false },
ref
) => {
return ( return (
<div <div
key={uuid}
ref={ref} ref={ref}
className={`flex justify-center items-end w-full ${ className={`flex justify-center items-end w-full ${
role === "user" ? USER_BACKGROUND_COLOR : AI_BACKGROUND_COLOR role === "user" ? USER_BACKGROUND_COLOR : AI_BACKGROUND_COLOR
......
...@@ -48,7 +48,7 @@ export default function ChatHistory({ history = [], workspace }) { ...@@ -48,7 +48,7 @@ export default function ChatHistory({ history = [], workspace }) {
return ( return (
<div <div
className="h-[89%] pb-[100px] pt-6 md:pt-0 md:pb-20 md:mx-0 overflow-y-scroll flex flex-col justify-start no-scroll" className="h-full md:h-[83%] pb-[100px] pt-6 md:pt-0 md:pb-20 md:mx-0 overflow-y-scroll flex flex-col justify-start no-scroll"
id="chat-history" id="chat-history"
> >
{history.map((props, index) => { {history.map((props, index) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment