Skip to content

Commit

Permalink
Merge pull request #180 from Team-Crops/fix/166-chat-notice-bubble
Browse files Browse the repository at this point in the history
채팅창 공지사항 텍스트 표시
  • Loading branch information
jaewoongs authored Jun 22, 2024
2 parents d1ae8ce + f3ea8d4 commit 2e56a9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/molecules/NoticeBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ const Bubble = styled.div`
margin: 0 auto;
padding: 5px 20px;
background-color: rgb(238 238 238 / 100%);
background-color: #eee;
border-radius: 20px;
`;
16 changes: 9 additions & 7 deletions src/hooks/use-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ export function useChatSubscription(id: Chat['id']) {
interface ChatMessagesResponse {
pageResult: {
values: {
content?: string;
imageUrl?: string;
messageId: number;
createdAt: string;
messageType: 'TEXT' | 'IMAGE';
messageId: number;
userId: number;
createdAt: string;
content?: string;
imageUrl?: string;
notice?: string;
}[];
hasNext: boolean;
};
Expand All @@ -54,12 +55,13 @@ export function useChatMessagesQuery(id: Chat['id']) {
const json = await fitFetcher<ChatMessagesResponse>(url);
return {
messages: json.pageResult.values.map((v) => ({
createdAt: v.createdAt,
messageType: v.messageType,
id: v.messageId,
userId: v.userId,
content: v.content,
imageUrl: v.imageUrl,
userId: v.userId,
messageType: v.messageType,
createdAt: v.createdAt,
notice: v.notice,
})),
hasNext: json.pageResult.hasNext,
} as { messages: Message[]; hasNext: boolean };
Expand Down

0 comments on commit 2e56a9b

Please sign in to comment.