diff --git a/apps/codac-quasseln/src/components/chat/chat-bubble.tsx b/apps/codac-quasseln/src/components/chat/chat-bubble.tsx index df89ae43..7dd142e0 100644 --- a/apps/codac-quasseln/src/components/chat/chat-bubble.tsx +++ b/apps/codac-quasseln/src/components/chat/chat-bubble.tsx @@ -1,11 +1,14 @@ +import { Bubble } from "codac-sassy"; import React from "react"; import { useAuth } from "#/contexts/authContext"; export const ChatBubble = ({ message }: { message: any }) => { const { user } = useAuth(); + const author = message?.author?.data?.attributes?.username || (message?.author?.username as string); + const myMessage = user?.username === author; // Check if user is the author const formatDate = (timestamp: string) => { const date = new Date(timestamp); @@ -28,16 +31,14 @@ export const ChatBubble = ({ message }: { message: any }) => { }; return ( -
-
-
- {user?.username !== author ? {author} : me}{" "} - {formatDate(message.timestamp)} -
-
-

{message.body}

-
-
-
+ <> + + ); }; diff --git a/apps/codac-quasseln/src/components/chat/chat-room.tsx b/apps/codac-quasseln/src/components/chat/chat-room.tsx index 4d5d8094..126545de 100644 --- a/apps/codac-quasseln/src/components/chat/chat-room.tsx +++ b/apps/codac-quasseln/src/components/chat/chat-room.tsx @@ -95,40 +95,43 @@ const ChatRoom: React.FC = ({ roomId }) => { + {chatHistory.map((message) => ( ))} + {roomId !== "" && ( <> {typing &&

someone typing...

}
- ; + + return ( +