Undep
This commit is contained in:
@@ -76,7 +76,6 @@ import {
|
||||
} from "@mui/material";
|
||||
import { Formik } from "formik";
|
||||
import { t } from "i18next";
|
||||
import { GalleryContext } from "pages/gallery";
|
||||
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { PublicCollectionGalleryContext } from "utils/publicCollectionGallery";
|
||||
import * as Yup from "yup";
|
||||
@@ -108,6 +107,11 @@ export interface FileInfoProps {
|
||||
fileToCollectionsMap?: Map<number, number[]>;
|
||||
collectionNameMap?: Map<number, string>;
|
||||
showCollectionChips: boolean;
|
||||
/**
|
||||
* Called when the user selects a collection from among the collections that
|
||||
* the file belongs to.
|
||||
*/
|
||||
onSelectCollection: (collectionID: number) => void;
|
||||
/**
|
||||
* Called when the user selects a person in the file info panel.
|
||||
*/
|
||||
@@ -126,12 +130,12 @@ export const FileInfo: React.FC<FileInfoProps> = ({
|
||||
collectionNameMap,
|
||||
showCollectionChips,
|
||||
closePhotoViewer,
|
||||
onSelectCollection,
|
||||
onSelectPerson,
|
||||
}) => {
|
||||
const { mapEnabled } = useSettingsSnapshot();
|
||||
|
||||
const { showMiniDialog } = useContext(AppContext);
|
||||
const galleryContext = useContext(GalleryContext);
|
||||
const publicCollectionGalleryContext = useContext(
|
||||
PublicCollectionGalleryContext,
|
||||
);
|
||||
@@ -173,7 +177,7 @@ export const FileInfo: React.FC<FileInfoProps> = ({
|
||||
}
|
||||
|
||||
const onCollectionChipClick = (collectionID) => {
|
||||
galleryContext.onShowCollection(collectionID);
|
||||
onSelectCollection(collectionID);
|
||||
closePhotoViewer();
|
||||
};
|
||||
|
||||
|
||||
@@ -975,6 +975,7 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
|
||||
refreshPhotoswipe={refreshPhotoswipe}
|
||||
fileToCollectionsMap={fileToCollectionsMap}
|
||||
collectionNameMap={collectionNameMap}
|
||||
onSelectCollection={galleryContext.onShowCollection}
|
||||
onSelectPerson={onSelectPerson}
|
||||
/>
|
||||
<ImageEditorOverlay
|
||||
|
||||
Reference in New Issue
Block a user