diff --git a/src/components/Upload/UploadTypeSelector/index.tsx b/src/components/Upload/UploadTypeSelector/index.tsx index 6579e8df7..a4bef074f 100644 --- a/src/components/Upload/UploadTypeSelector/index.tsx +++ b/src/components/Upload/UploadTypeSelector/index.tsx @@ -7,13 +7,22 @@ import { UploadTypeOption } from './option'; import DialogTitleWithCloseButton from 'components/DialogBox/TitleWithCloseButton'; import { Box, Dialog, Stack, Typography } from '@mui/material'; +interface Iprops { + onHide: () => void; + show: boolean; + uploadFiles: () => void; + uploadFolders: () => void; + uploadGoogleTakeoutZips: () => void; + hideZipUploadOption?: boolean; +} export default function UploadTypeSelector({ onHide, show, uploadFiles, uploadFolders, uploadGoogleTakeoutZips, -}) { + hideZipUploadOption, +}: Iprops) { return ( }> {constants.UPLOAD_DIRS} - }> - {constants.UPLOAD_GOOGLE_TAKEOUT} - + {!hideZipUploadOption && ( + }> + {constants.UPLOAD_GOOGLE_TAKEOUT} + + )} {constants.DRAG_AND_DROP_HINT} diff --git a/src/components/Upload/Uploader.tsx b/src/components/Upload/Uploader.tsx index 4e2a0b0fb..751051eca 100644 --- a/src/components/Upload/Uploader.tsx +++ b/src/components/Upload/Uploader.tsx @@ -55,16 +55,16 @@ const FIRST_ALBUM_NAME = 'My First Album'; interface Props { syncWithRemote: (force?: boolean, silent?: boolean) => Promise; - closeCollectionSelector: () => void; + closeCollectionSelector?: () => void; closeUploadTypeSelector: () => void; - setCollectionSelectorAttributes: SetCollectionSelectorAttributes; - setCollectionNamerAttributes: SetCollectionNamerAttributes; + setCollectionSelectorAttributes?: SetCollectionSelectorAttributes; + setCollectionNamerAttributes?: SetCollectionNamerAttributes; setLoading: SetLoading; setShouldDisableDropzone: (value: boolean) => void; - showCollectionSelector: () => void; + showCollectionSelector?: () => void; setFiles: SetFiles; - setCollections: SetCollections; - isFirstUpload: boolean; + setCollections?: SetCollections; + isFirstUpload?: boolean; uploadTypeSelectorView: boolean; showSessionExpiredMessage: () => void; showUploadFilesDialog: () => void; @@ -72,6 +72,8 @@ interface Props { webFolderSelectorFiles: File[]; webFileSelectorFiles: File[]; dragAndDropFiles: File[]; + zipUploadDisabled?: boolean; + collection?: Collection; } export default function Uploader(props: Props) { @@ -599,6 +601,7 @@ export default function Uploader(props: Props) { uploadFiles={handleFileUpload} uploadFolders={handleFolderUpload} uploadGoogleTakeoutZips={handleZipUpload} + hideZipUploadOption={props.zipUploadDisabled} />