Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zewed committed Jan 28, 2024
1 parent 7617be9 commit 21f45de
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
8 changes: 1 addition & 7 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,7 @@ module.exports = {
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
},
],
"@typescript-eslint/restrict-template-expressions": "off",
},
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "@/styles/Colors.module.scss";
@use "@/styles/Spacings.module.scss";

.markdown {
Expand All @@ -23,3 +24,32 @@
}
}
}

.user {
color: Colors.$black;
}

.brain {
color: Colors.$white;
}

.thinking {
animation: pulse 1s infinite;
font-size: 2px;
line-height: 16px;
width: 16px;
display: flex;
justify-content: center;
}

@keyframes pulse {
0% {
font-size: 6px;
}
50% {
font-size: 16px;
}
100% {
font-size: 6px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ export const MessageContent = ({
} else {
setIsLog(false);
}
console.info(isUser);
}, [text]);

const { logs, cleanedText } = extractLog(text);

console.info(cleanedText);

return (
<div data-testid="chat-message-text">
{isLog && showLog && logs.length > 0 && (
Expand All @@ -51,9 +48,11 @@ export const MessageContent = ({
</div>
)}
<ReactMarkdown
className={`${styles.markdown ?? ""} ${
isUser ? "text-black" : "text-white"
} `}
className={`
${styles.markdown}
${isUser ? styles.user : styles.brain}
${cleanedText === "🧠" ? styles.thinking : ""}
`}
>
{cleanedText}
</ReactMarkdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export const generatePlaceHolderMessage = ({
}: GeneratePlaceHolderMessageProps): ChatMessage => {
return {
message_id: new Date().getTime().toString(),
message_time: new Date(new Date().setDate(new Date().getDate() + 1)).toISOString(),
assistant: 'Thinking..',
message_time: new Date(
new Date().setDate(new Date().getDate() + 1)
).toISOString(),
assistant: "🧠",
chat_id,
user_message,
};
Expand Down

0 comments on commit 21f45de

Please sign in to comment.