Skip to content

Commit

Permalink
error message when no users in chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
hppanpaliya committed May 1, 2023
1 parent 7d4ec01 commit 869b617
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Chat/UserList/UserList.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ const UsersList = () => {
{/* Loading indicator */}
{loading ? <UsersListSkeleton /> : ""}
{/* List of filtered users */}
{!loading && <UsersListItems users={filteredUsers} />}
{!loading && filteredUsers.length > 0 ? (
<UsersListItems users={filteredUsers} />
) : (
!loading && (
<Typography variant="body1" className="no-users-message" paddingTop={5}>
Search a username to send message
</Typography>
)
)}
</div>
);
};
Expand Down

0 comments on commit 869b617

Please sign in to comment.