use uploadTypeSelectorIntent as collectPhotos for shared-albums
This commit is contained in:
parent
05adbbc89b
commit
9f2c5ff833
|
@ -17,8 +17,7 @@ interface Iprops {
|
|||
uploadFiles: () => void;
|
||||
uploadFolders: () => void;
|
||||
uploadGoogleTakeoutZips: () => void;
|
||||
hideZipUploadOption?: boolean;
|
||||
uploadTypeSelectorIntent?: UploadTypeSelectorIntent;
|
||||
uploadTypeSelectorIntent: UploadTypeSelectorIntent;
|
||||
}
|
||||
export default function UploadTypeSelector({
|
||||
onClose,
|
||||
|
@ -26,7 +25,6 @@ export default function UploadTypeSelector({
|
|||
uploadFiles,
|
||||
uploadFolders,
|
||||
uploadGoogleTakeoutZips,
|
||||
hideZipUploadOption,
|
||||
uploadTypeSelectorIntent,
|
||||
}: Iprops) {
|
||||
const publicCollectionGalleryContext = useContext(
|
||||
|
@ -57,12 +55,13 @@ export default function UploadTypeSelector({
|
|||
}}
|
||||
onClose={dialogCloseHandler({ onClose })}>
|
||||
<DialogTitleWithCloseButton onClose={onClose}>
|
||||
{publicCollectionGalleryContext.accessedThroughSharedURL
|
||||
{uploadTypeSelectorIntent ===
|
||||
UploadTypeSelectorIntent.collectPhotos
|
||||
? constants.SELECT_PHOTOS
|
||||
: uploadTypeSelectorIntent ===
|
||||
UploadTypeSelectorIntent.normalUpload
|
||||
? constants.UPLOAD
|
||||
: constants.IMPORT}
|
||||
UploadTypeSelectorIntent.import
|
||||
? constants.IMPORT
|
||||
: constants.UPLOAD}
|
||||
</DialogTitleWithCloseButton>
|
||||
<Box p={1.5} pt={0.5}>
|
||||
<Stack spacing={0.5}>
|
||||
|
@ -79,7 +78,8 @@ export default function UploadTypeSelector({
|
|||
startIcon={<FolderUploadIcon />}>
|
||||
{constants.UPLOAD_DIRS}
|
||||
</UploadTypeOption>
|
||||
{!hideZipUploadOption && (
|
||||
{uploadTypeSelectorIntent !==
|
||||
UploadTypeSelectorIntent.collectPhotos && (
|
||||
<UploadTypeOption
|
||||
onClick={uploadGoogleTakeoutZips}
|
||||
startIcon={<GoogleIcon />}>
|
||||
|
|
|
@ -81,9 +81,8 @@ interface Props {
|
|||
webFolderSelectorFiles: File[];
|
||||
webFileSelectorFiles: File[];
|
||||
dragAndDropFiles: File[];
|
||||
zipUploadDisabled?: boolean;
|
||||
uploadCollection?: Collection;
|
||||
uploadTypeSelectorIntent?: UploadTypeSelectorIntent;
|
||||
uploadTypeSelectorIntent: UploadTypeSelectorIntent;
|
||||
}
|
||||
|
||||
export default function Uploader(props: Props) {
|
||||
|
@ -753,7 +752,6 @@ export default function Uploader(props: Props) {
|
|||
uploadFiles={handleFileUpload}
|
||||
uploadFolders={handleFolderUpload}
|
||||
uploadGoogleTakeoutZips={handleZipUpload}
|
||||
hideZipUploadOption={props.zipUploadDisabled}
|
||||
uploadTypeSelectorIntent={props.uploadTypeSelectorIntent}
|
||||
/>
|
||||
<UploadProgress
|
||||
|
|
|
@ -48,6 +48,7 @@ import UploadButton from 'components/Upload/UploadButton';
|
|||
import bs58 from 'bs58';
|
||||
import AddPhotoAlternateOutlined from '@mui/icons-material/AddPhotoAlternateOutlined';
|
||||
import ComlinkCryptoWorker from 'utils/comlink/ComlinkCryptoWorker';
|
||||
import { UploadTypeSelectorIntent } from 'types/gallery';
|
||||
|
||||
const Loader = () => (
|
||||
<VerticallyCentered>
|
||||
|
@ -440,7 +441,9 @@ export default function PublicCollectionGallery() {
|
|||
showUploadFilesDialog={openFileSelector}
|
||||
showUploadDirsDialog={openFolderSelector}
|
||||
showSessionExpiredMessage={showPublicLinkExpiredMessage}
|
||||
zipUploadDisabled
|
||||
uploadTypeSelectorIntent={
|
||||
UploadTypeSelectorIntent.collectPhotos
|
||||
}
|
||||
/>
|
||||
</FullScreenDropZone>
|
||||
</PublicCollectionGalleryContext.Provider>
|
||||
|
|
|
@ -23,6 +23,7 @@ export type MergedSourceURL = {
|
|||
export enum UploadTypeSelectorIntent {
|
||||
normalUpload,
|
||||
import,
|
||||
collectPhotos,
|
||||
}
|
||||
export type GalleryContextType = {
|
||||
thumbs: Map<number, string>;
|
||||
|
|
Loading…
Reference in a new issue