-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Zustand for state management #43
Using Zustand for state management #43
Conversation
- Manage roommates in state - Includes sender profile pic in notification - Manages messages in state > Includes changes to server code. REDEPLOY
Someone is attempting to deploy a commit to a Personal Account owned by @manuelalferez on Vercel. @manuelalferez first needs to authorize it. |
This pull request is being automatically deployed with Vercel (learn more). chat – ./client🔍 Inspect: https://vercel.com/manuelalferez/chat/5BtC7CnHzhjPJxTKkBmz69i8gJ3x chatcus – ./client🔍 Inspect: https://vercel.com/manuelalferez/chatcus/EdR9bkakUXndUXjV9BLzwKrd5nsd |
@manuelalferez If you merge this PR, please also redeploy the server code to Heroku to update the changes to server code |
- Input height - Not leaving room on exit button - Roommates component key - Persistent state clears on leaving room Added - No. of participants - Improved Messages UI (pfp position)
ChangesPersistent stateState is maintained even on refresh = Your messages won't disappear when you refresh your tab RoommatesNo. of roommates and the roommates' names along with their profile pics are shown on the right of the messages Fixed bugs
|
Thanks for your patient @gitwikc, I will read everything in depth when I have a second. I will try to do it today |
Awesome @gitwikc!!! Do you know why it can be? |
@manuelalferez I tried to fix the bug. Please check if everything works fine and report any other bugs I may have overlooked. |
Perfect @gitwikc, problem solved. I was checking the Responsive Design: Does not look as it should. We have three options:
You decide 😊 |
@manuelalferez I think merging this PR now and creating an issue for the responsive feature is appropriate since it's a different topic from state management |
@manuelalferez we need to change session storage to other storage solution. |
@iamvishal345 Do you mean instead of using a sessionStorage, store the data in a database? |
Added Zustand state management
This pull reques includes the addition of state management for the app using Zustand. Changes introduced are:
Note
Roommates list 🧑🤝🧑 🧑🤝🧑
The list of roommates is stored in the Zustand store and can be accessed by
Uses
💡 Using the list of roommates, a new component can be created which would display all the users in the current room. The roommates list comes from the server's
server/src/users.js
:getUsersInRoom(room)
function. So the format of each roommate in the list is of the formAlso, in each
admin
type message from the server, the roommate list is passed and set in the client's store.Auto Profile pic 🐱
If no profile pic URL is specified, a cute kitty profile pic is automatically assigned to the user using
https://robohash.org/<username>?set=set4