Web: Files: Hide the file destination when checkbox is not set.

This commit is contained in:
Tatiana Lopaeva 2022-01-12 17:09:21 +03:00
parent d2fb921a7c
commit 332fc5866a
2 changed files with 18 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import Checkbox from "@appserver/components/checkbox";
import { withTranslation, Trans } from "react-i18next";
import { inject, observer } from "mobx-react";
import Loaders from "@appserver/common/components/Loaders";
import { FolderType } from "@appserver/common/constants";
const ConvertDialogComponent = (props) => {
const {
@ -30,12 +31,12 @@ const ConvertDialogComponent = (props) => {
let rootFolderTitle = "";
const convertSingleFile = !!convertItem;
const sortedFolder = isRecentFolder || isFavoritesFolder || isShareFolder;
if (
convertSingleFile &&
(isRecentFolder || isFavoritesFolder || isShareFolder)
) {
rootFolderTitle = rootFoldersTitles[convertItem.rootFolderType];
if (convertSingleFile && sortedFolder) {
rootFolderTitle = isShareFolder
? rootFoldersTitles[FolderType.USER]
: rootFoldersTitles[convertItem.rootFolderType];
}
const [hideMessage, setHideMessage] = useState(false);
@ -90,8 +91,12 @@ const ConvertDialogComponent = (props) => {
isChecked={storeOriginalFiles}
onChange={onChangeFormat}
/>
{convertSingleFile && rootFolderTitle && (
<div className="convert_dialog_file-destination">
{convertSingleFile && sortedFolder && (
<div
className={`convert_dialog_file-destination ${
storeOriginalFiles ? "file-destination_visible" : ""
}`}
>
<Trans
i18nKey="FileDestination"
ns="ConvertDialog"

View File

@ -115,6 +115,12 @@ const ModalDialogContainer = styled(ModalDialog)`
.convert_dialog_file-destination {
padding-top: 16px;
}
.convert_dialog_file-destination {
opacity: 0;
}
.file-destination_visible {
opacity: 1;
}
}
}
.convert_dialog_footer {