Clean
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import { t } from "i18next";
|
||||
import { useContext, useEffect, useRef } from "react";
|
||||
|
||||
import DialogTitleWithCloseButton, {
|
||||
dialogCloseHandler,
|
||||
} from "@ente/shared/components/DialogBox/TitleWithCloseButton";
|
||||
@@ -10,10 +7,13 @@ import GoogleIcon from "@mui/icons-material/Google";
|
||||
import { default as FileUploadIcon } from "@mui/icons-material/ImageOutlined";
|
||||
import { default as FolderUploadIcon } from "@mui/icons-material/PermMediaOutlined";
|
||||
import { Box, Dialog, Stack, Typography } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import React, { useContext, useEffect, useRef } from "react";
|
||||
import { UploadTypeSelectorIntent } from "types/gallery";
|
||||
import { isMobileOrTable } from "utils/common/deviceDetection";
|
||||
import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";
|
||||
interface Iprops {
|
||||
|
||||
interface UploadTypeSelectorProps {
|
||||
onClose: () => void;
|
||||
show: boolean;
|
||||
uploadFiles: () => void;
|
||||
@@ -21,14 +21,24 @@ interface Iprops {
|
||||
uploadGoogleTakeoutZips: () => void;
|
||||
uploadTypeSelectorIntent: UploadTypeSelectorIntent;
|
||||
}
|
||||
export default function UploadTypeSelector({
|
||||
|
||||
/**
|
||||
* Request the user to specify which type of file / folder / zip it is that they
|
||||
* wish to upload.
|
||||
*
|
||||
* This selector (and the "Upload" button) is functionally redundant, the user
|
||||
* can just drag and drop any of these into the app to directly initiate the
|
||||
* upload. But having an explicit easy to reach button is also necessary for new
|
||||
* users, or for cases where drag-and-drop might not be appropriate.
|
||||
*/
|
||||
const UploadTypeSelector: React.FC<UploadTypeSelectorProps> = ({
|
||||
onClose,
|
||||
show,
|
||||
uploadFiles,
|
||||
uploadFolders,
|
||||
uploadGoogleTakeoutZips,
|
||||
uploadTypeSelectorIntent,
|
||||
}: Iprops) {
|
||||
}) => {
|
||||
const publicCollectionGalleryContext = useContext(
|
||||
PublicCollectionGalleryContext,
|
||||
);
|
||||
@@ -100,4 +110,6 @@ export default function UploadTypeSelector({
|
||||
</Box>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default UploadTypeSelector;
|
||||
|
||||
Reference in New Issue
Block a user