Web: InfoPanel: Removed list re-rendering after ComboBox action.

This commit is contained in:
Tatiana Lopaeva 2023-07-10 16:54:18 +03:00
parent 74757c6da0
commit 1df512ef73
2 changed files with 6 additions and 9 deletions

View File

@ -2,7 +2,7 @@ import React, { useState } from "react";
import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url"; import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url";
import { StyledUser } from "../../styles/members"; import { StyledUser } from "../../styles/members";
import Avatar from "@docspace/components/avatar"; import Avatar from "@docspace/components/avatar";
import { ComboBox } from "@docspace/components"; import ComboBox from "@docspace/components/combobox";
import DefaultUserPhotoUrl from "PUBLIC_DIR/images/default_user_photo_size_82-82.png"; import DefaultUserPhotoUrl from "PUBLIC_DIR/images/default_user_photo_size_82-82.png";
import toastr from "@docspace/components/toast/toastr"; import toastr from "@docspace/components/toast/toastr";
import { isMobileOnly } from "react-device-detect"; import { isMobileOnly } from "react-device-detect";
@ -20,7 +20,6 @@ const User = ({
selectionParentRoom, selectionParentRoom,
setSelectionParentRoom, setSelectionParentRoom,
changeUserType, changeUserType,
isScrollLocked,
setIsScrollLocked, setIsScrollLocked,
}) => { }) => {
if (!selectionParentRoom) return null; if (!selectionParentRoom) return null;
@ -113,8 +112,8 @@ const User = ({
} }
}; };
const onToggle = () => { const onToggle = (e, isOpen) => {
setIsScrollLocked(!isScrollLocked); setIsScrollLocked(isOpen);
}; };
const userAvatar = user.hasAvatar ? user.avatar : DefaultUserPhotoUrl; const userAvatar = user.hasAvatar ? user.avatar : DefaultUserPhotoUrl;

View File

@ -28,7 +28,7 @@ const Members = ({
selectionParentRoom, selectionParentRoom,
setSelectionParentRoom, setSelectionParentRoom,
isScrollLocked,
setIsScrollLocked, setIsScrollLocked,
getRoomMembers, getRoomMembers,
@ -184,7 +184,6 @@ const Members = ({
selectionParentRoom={selectionParentRoom} selectionParentRoom={selectionParentRoom}
setSelectionParentRoom={setSelectionParentRoom} setSelectionParentRoom={setSelectionParentRoom}
changeUserType={changeUserType} changeUserType={changeUserType}
isScrollLocked={isScrollLocked}
setIsScrollLocked={setIsScrollLocked} setIsScrollLocked={setIsScrollLocked}
/> />
))} ))}
@ -222,7 +221,6 @@ const Members = ({
selectionParentRoom={selectionParentRoom} selectionParentRoom={selectionParentRoom}
setSelectionParentRoom={setSelectionParentRoom} setSelectionParentRoom={setSelectionParentRoom}
changeUserType={changeUserType} changeUserType={changeUserType}
isScrollLocked={isScrollLocked}
setIsScrollLocked={setIsScrollLocked} setIsScrollLocked={setIsScrollLocked}
/> />
))} ))}
@ -250,7 +248,7 @@ export default inject(
updateRoomMembers, updateRoomMembers,
setUpdateRoomMembers, setUpdateRoomMembers,
isScrollLocked,
setIsScrollLocked, setIsScrollLocked,
} = auth.infoPanelStore; } = auth.infoPanelStore;
const { const {
@ -273,7 +271,7 @@ export default inject(
setIsMobileHidden, setIsMobileHidden,
selectionParentRoom, selectionParentRoom,
setSelectionParentRoom, setSelectionParentRoom,
isScrollLocked,
setIsScrollLocked, setIsScrollLocked,
getRoomMembers, getRoomMembers,