From 66c7af62f69087723a3886e7e4f290d1eb38078c Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 5 Nov 2020 08:18:57 +1100 Subject: [PATCH] Add gallery file info (#919) --- .../Galleries/GalleryDetails/Gallery.tsx | 25 ++++++------ .../GalleryDetails/GalleryFileInfoPanel.tsx | 40 +++++++++++++++++++ 2 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 ui/v2.5/src/components/Galleries/GalleryDetails/GalleryFileInfoPanel.tsx diff --git a/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx b/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx index 88eccb37a..9b3db9a12 100644 --- a/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx @@ -10,6 +10,7 @@ import { GalleryDetailPanel } from "./GalleryDetailPanel"; import { DeleteGalleriesDialog } from "../DeleteGalleriesDialog"; import { GalleryImagesPanel } from "./GalleryImagesPanel"; import { GalleryAddPanel } from "./GalleryAddPanel"; +import { GalleryFileInfoPanel } from "./GalleryFileInfoPanel"; interface IGalleryParams { id?: string; @@ -92,13 +93,13 @@ export const Gallery: React.FC = () => { Details - {/* {gallery.gallery ? ( + {gallery.path ? ( - Gallery + + File Info + - ) : ( - "" - )} */} + ) : undefined} Edit @@ -110,13 +111,13 @@ export const Gallery: React.FC = () => { - {/* {gallery.gallery ? ( - - - - ) : ( - "" - )} */} + + + = ( + props: IGalleryFileInfoPanelProps +) => { + function renderChecksum() { + return ( +
+ Checksum + {props.gallery.checksum} +
+ ); + } + + function renderPath() { + const { + gallery: { path }, + } = props; + return ( +
+ Path + + {`file://${props.gallery.path}`}{" "} + +
+ ); + } + + return ( +
+ {renderChecksum()} + {renderPath()} +
+ ); +};