Client: PublicRoom: Fixed context options for room inside sdk frame

This commit is contained in:
Ilya Oleshko 2024-04-27 17:07:19 +03:00
parent 2fe701f88d
commit eeabb432b8
2 changed files with 10 additions and 2 deletions

View File

@ -728,6 +728,7 @@ const SectionHeaderContent = (props) => {
haveLinksRight,
isPublicRoomType,
isPublicRoom,
isFrame,
} = props;
const isArchive = selectedFolder.rootFolderType === FolderType.Archive;
@ -739,12 +740,14 @@ const SectionHeaderContent = (props) => {
label: t("Files:CopyLink"),
icon: TabletLinkReactSvgUrl,
onClick: onShareRoom,
disabled: isFrame,
},
security?.Download && {
{
key: "public-room_edit",
label: t("Common:Download"),
icon: DownloadReactSvgUrl,
onClick: onDownloadAll,
disabled: !security?.Download,
},
];
}

View File

@ -81,6 +81,11 @@ const ControlButtons = ({
const children = tariffBar ? React.cloneElement(tariffBar, { title }) : null;
const isTabletView = isTablet();
const contextOptionsFolder = getContextOptionsFolder();
const containVisible = contextOptionsFolder.some(
(item) => item.disabled === false,
);
return (
<StyledControlButtonContainer isFrame={isFrame} showTitle={showTitle}>
{!isRootFolder || (isTrashFolder && !isEmptyFilesList) ? (
@ -165,7 +170,7 @@ const ControlButtons = ({
/>
)}
{isPublicRoom && (
{isPublicRoom && containVisible && (
<ContextButton
id="header_optional-button"
className="option-button"