Web: Client: InvitePanel: Added missing property for Item access selector
This commit is contained in:
parent
4723682eb4
commit
a907c659dc
@ -24,6 +24,7 @@ const Item = ({
|
||||
changeInviteItem,
|
||||
setHasErrors,
|
||||
roomType,
|
||||
isOwner,
|
||||
}) => {
|
||||
const { avatar, displayName, email, id, errors, access } = item;
|
||||
|
||||
@ -34,7 +35,7 @@ const Item = ({
|
||||
const [inputValue, setInputValue] = useState(name);
|
||||
const [parseErrors, setParseErrors] = useState(errors);
|
||||
|
||||
const accesses = getAccessOptions(t, roomType, true);
|
||||
const accesses = getAccessOptions(t, roomType, true, false, isOwner);
|
||||
|
||||
const defaultAccess = accesses.find((option) => option.access === +access);
|
||||
|
||||
|
@ -17,6 +17,7 @@ const Row = memo(({ data, index, style }) => {
|
||||
t,
|
||||
setHasErrors,
|
||||
roomType,
|
||||
isOwner,
|
||||
} = data;
|
||||
|
||||
if (inviteItems === undefined) return;
|
||||
@ -33,6 +34,7 @@ const Row = memo(({ data, index, style }) => {
|
||||
inviteItems={inviteItems}
|
||||
setHasErrors={setHasErrors}
|
||||
roomType={roomType}
|
||||
isOwner={isOwner}
|
||||
/>
|
||||
</StyledRow>
|
||||
);
|
||||
@ -45,6 +47,7 @@ const ItemsList = ({
|
||||
changeInviteItem,
|
||||
setHasErrors,
|
||||
roomType,
|
||||
isOwner,
|
||||
}) => {
|
||||
const [bodyHeight, setBodyHeight] = useState(0);
|
||||
const [offsetTop, setOffsetTop] = useState(0);
|
||||
@ -79,6 +82,7 @@ const ItemsList = ({
|
||||
changeInviteItem,
|
||||
setHasErrors,
|
||||
roomType,
|
||||
isOwner,
|
||||
t,
|
||||
}}
|
||||
outerElementType={CustomScrollbarsVirtualList}
|
||||
@ -89,12 +93,14 @@ const ItemsList = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ dialogsStore }) => {
|
||||
export default inject(({ auth, dialogsStore }) => {
|
||||
const { setInviteItems, inviteItems, changeInviteItem } = dialogsStore;
|
||||
const { isOwner } = auth.userStore.user;
|
||||
|
||||
return {
|
||||
setInviteItems,
|
||||
inviteItems,
|
||||
changeInviteItem,
|
||||
isOwner,
|
||||
};
|
||||
})(observer(ItemsList));
|
||||
|
Loading…
Reference in New Issue
Block a user