A
A
AlexKindGeek2018-09-29 22:25:54
React
AlexKindGeek, 2018-09-29 22:25:54

How to design a chat?

Hello. There is a task to make a chat.

Here is the design:
5bafced12f662131921226.png

All unread chats should be in the top.
The problem is that the entire list is implemented as Infinite scroll because there can be a lot of chats and the backend gives them randomly
. On the backend, I asked to make a route to get all unread and read chats.
This is how it looks request body
5bafd01b00940466559118.png
And pass the structure to
5bafd0ea9fbf9223281230.png
Please tell me if I have a normal idea of ​​​​redesigning or is it possible to do it all in a simpler way?
This is what the component looks like when I design it:
import React, { Component } from "react";

/**Components */
import UserControls from "./UserControls";
import UnreadUsers from "./UnreadUsers";
import AllUser from "./AllUser";


export default class UserComponent extends Component {
  render() {
    return (
      <div className="scroll-container">
        <UserControls /> // компонент с input для поиска и фильтрации
        <div className="users-list">
          <UnreadUsers /> 
          <AllUser />
        </div>
      </div>
    );
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question