7 Commits

Author SHA1 Message Date
Rankin Zheng
1e092e23cf Move initial messages creation from MessageList to ChatStore
- Removed useEffect hook in MessageList that was adding initial messages.
- Added logic in ChatStore to add initial messages when messages length is 0.
2023-08-22 14:46:06 +08:00
Rankin Zheng
bcbd399794 Refactor CurrentMessage component and update MessageList
- Refactored CurrentMessage component to destructure properties from chat.
- Added useEffect hooks to handle message generation and updating in CurrentMessage.
- Updated MessageList to use useEffect to add initial messages to chat.
2023-08-22 14:34:43 +08:00
Rankin Zheng
2975bd0c5f Refactor MessageAvatar component and update ChatStore
- Expanded MessageAvatar props to include avatarType, copyMessage, messageContexts, and deleteHash.
- Updated MessageAvatar to use new props instead of item prop.
- Updated MessageList to pass new props to MessageAvatar.
- Refactored deleteMessage function in ChatStore to accept messageHash instead of item.
- Updated setContexts function in InputStore to accept IChatContext array.
2023-08-21 15:28:19 +08:00
Rankin Zheng
b7c16f709f Rename CodeBlock to MessageBody
- Renamed CodeBlock component to MessageBody for better clarity.
- Updated all references of CodeBlock to MessageBody in the codebase.
- Moved CodeBlock related files to MessageBody directory.
2023-08-21 14:07:11 +08:00
Rankin Zheng
d514446666 Extract MessageContext component from MessageList
- Created a new file for MessageContext component.
- Removed MessageContext related code from MessageList.
- Imported MessageContext in MessageList.
2023-08-21 14:00:34 +08:00
Rankin Zheng
051fc4a371 Rename MessageHeader to MessageAvatar
- Renamed MessageHeader component to MessageAvatar for better clarity.
- Updated all references of MessageHeader to MessageAvatar in the codebase.
- Moved avatar images from MessageHeader directory to MessageAvatar directory.
2023-08-21 13:56:42 +08:00
Rankin Zheng
e0487015d6 Rename MessageContainer to MessageList
- Renamed MessageContainer component to MessageList for better clarity.
- Updated all references of MessageContainer to MessageList in the codebase.
2023-08-21 13:53:32 +08:00