8 Commits

Author SHA1 Message Date
Rankin Zheng
36615f1366 Update MessageContainer and MessageHeader components
- Made 'contexts' prop optional in MessageContainer component.
- Refactored MessageContainer component to return a fragment.
- Made 'showEdit' prop optional in MessageHeader component.
2023-08-18 16:21:51 +08:00
Rankin Zheng
13a80ba67f Refactor MessageHeader component and related stores
- Added IProps interface and updated the MessageHeader component to use typed props in MessageHeader/index.tsx.
- Updated the deleteMessage function in ChatStore.ts to accept an IMessage object instead of a params object.
- Added an export for the IMessage type in ChatStore.ts.
- Updated the setContexts action in InputStore.ts to accept an array of IChatContext objects and to push a copy of each context object to self.contexts.
- Added an export for the IChatContext type in InputStore.ts.
2023-08-18 11:43:26 +08:00
Rankin Zheng
916b45f54d Refactor async actions in ChatStore to use MobX flow
- Refactored fetchHistoryMessages and deleteMessage actions in ChatStore to use MobX flow for handling async operations.
- Updated calls to these actions in MessageHeader and ChatPanel components to handle promises returned by these actions.
2023-08-18 00:29:03 +08:00
Rankin Zheng
2c144c4d5f Refactor MessageContainer and MessageHeader components to use MobX
- Replaced Redux hooks with MobX hooks in MessageContainer and MessageHeader components.
- Removed Redux actions and replaced them with equivalent MobX actions.
- Updated event handlers to use MobX actions instead of Redux actions.
- Replaced Redux selectors with equivalent MobX observables.
- Converted MessageContainer and MessageHeader components to observer components.
2023-08-18 00:24:10 +08:00
Rankin Zheng
96bef7ff1d Adjust margin in MessageHeader component
- Added marginRight of 10px to the container holding the ActionIcon in MessageHeader.
- Also applied marginRight of 10px to the ActionIcon itself for consistent spacing.
2023-08-04 11:07:55 +08:00
Rankin Zheng
8da3083e9e Fix import path and remove unused CopyWebpackPlugin
- Fixed import path for avatar_devchat.svg in MessageHeader/index.tsx.
- Removed unused CopyWebpackPlugin from webpack.config.js.
2023-08-03 17:16:15 +08:00
Rankin Zheng
0bcc339447 Move Icons and avatar images to appropriate folders
- Moved Icons.tsx from views to components/ChatIcons folder.
- Updated import path for Icons in InputMessage/index.tsx.
- Moved avatar_devchat.svg, avatar_spaceman.png, and avatar_user.svg from views to components/MessageHeader folder.
- Updated import paths for avatar images in MessageHeader/index.tsx.
2023-08-03 17:01:12 +08:00
Rankin Zheng
9663f91fe8 Move MessageHeader to components folder
- Moved MessageHeader from views to components folder.
- Updated import path for MessageHeader in MessageContainer.tsx.
2023-08-03 16:51:39 +08:00