Skip to content

Conversation

@L4B0MB4
Copy link
Contributor

@L4B0MB4 L4B0MB4 commented Dec 6, 2024

This pull request introduces significant changes to the chat and main page functionalities, along with some refactoring and improvements to the UI components. The most important changes include the addition of chat-related components, updates to routing, and enhancements to the header and notification system.

Chat Functionality Enhancements:

  • Added ChatSidebar, ChatList, ChatItem, and ChatWindow components to manage and display chat functionalities. These components handle the display of chat rooms, messages, and user interactions. [1] [2] [3] [4] [5]
  • Integrated Redux state management for chats, including actions for fetching chats, setting active chat, and marking messages as read. [1] [2]

Routing and Page Structure:

  • Updated App.tsx to use wildcard routing for the main component, allowing for nested routes.
  • Refactored the main page layout by splitting it into subpages (MainPage and ChatsPage) and updating the main routing to include these subpages. [1] [2]

UI Components and Styling:

  • Added new UI components such as Badge and Popover for improved styling and functionality. These components are used for displaying notifications and other UI elements. [1] [2]
  • Enhanced the header to include links to the home and chats pages, and added a notification badge for new messages. [1] [2]

Dependency Updates:

  • Updated @radix-ui/react-avatar to version ^1.1.1 and added @radix-ui/react-popover to the dependencies for improved UI components.

Code Refactoring:

  • Removed unused imports and effects from postlist.tsx and usersPanel.tsx, simplifying the code. [1] [2] [3]
  • Added a safeguard in chooseTwoCharsFromName to handle cases where the input name might be empty.

These changes collectively enhance the chat functionality, improve the user interface, and streamline the codebase for better maintainability.

…tructure, and create ChatWindowWrapper for state management
…hatList to manage active chat, and implement getChatById in chatSlice for improved chat loading
…ance avatar handling, and improve message structure; update user fetching in Main component
…ay, and improve name handling in utility function
…g chat by ID, simplify ChatSidebar by removing setChatId prop, enhance ChatWindow to handle message sending, and implement unique array utility for message management
Refactor websocket integration: replace WebsocketProvider with useChatWebsocket and usePostWebsocket hooks, update chatSlice to handle chat room messages, and enhance websocket initialization logic
…and ChatList, introduce ChatRoomWithNotifications type, and implement utility for managing unique messages in chatSlice
…tions, update unread message handling, and add user avatar display in the header component
@L4B0MB4 L4B0MB4 merged commit a143036 into master Dec 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants