diff --git a/client/src/components/Journey/PhotoLightbox.tsx b/client/src/components/Journey/PhotoLightbox.tsx index 0bb5225d..e3096ee1 100644 --- a/client/src/components/Journey/PhotoLightbox.tsx +++ b/client/src/components/Journey/PhotoLightbox.tsx @@ -1,6 +1,5 @@ import { useState, useEffect, useCallback, useRef } from 'react' -import { ChevronLeft, ChevronRight, X, Camera, Aperture } from 'lucide-react' -import apiClient from '../../api/client' +import { ChevronLeft, ChevronRight, X } from 'lucide-react' interface LightboxPhoto { id: string @@ -11,16 +10,6 @@ interface LightboxPhoto { owner_id?: number | null } -interface ExifData { - camera?: string - lens?: string - focalLength?: string - aperture?: string - shutter?: string - iso?: number - fileName?: string -} - interface Props { photos: LightboxPhoto[] startIndex?: number @@ -29,8 +18,6 @@ interface Props { export default function PhotoLightbox({ photos, startIndex = 0, onClose }: Props) { const [idx, setIdx] = useState(startIndex) - const [exif, setExif] = useState(null) - const [exifLoading, setExifLoading] = useState(false) const touchStart = useRef<{ x: number; y: number } | null>(null) const photo = photos[idx] @@ -50,32 +37,6 @@ export default function PhotoLightbox({ photos, startIndex = 0, onClose }: Props return () => window.removeEventListener('keydown', onKey) }, [prev, next, onClose]) - // Fetch EXIF data for Immich photos - useEffect(() => { - setExif(null) - if (!photo || photo.provider !== 'immich' || !photo.asset_id || !photo.owner_id) return - let cancelled = false - setExifLoading(true) - apiClient.get(`/integrations/memories/immich/assets/0/${photo.asset_id}/${photo.owner_id}/info`) - .then(r => { - if (!cancelled && r.data) { - const d = r.data - const parts: Partial = {} - if (d.camera && d.camera.trim() && d.camera !== 'undefined undefined') parts.camera = d.camera - if (d.lens) parts.lens = d.lens - if (d.focalLength) parts.focalLength = d.focalLength - if (d.aperture) parts.aperture = d.aperture - if (d.shutter) parts.shutter = d.shutter - if (d.iso) parts.iso = d.iso - if (d.fileName) parts.fileName = d.fileName - if (Object.keys(parts).length > 0) setExif(parts) - } - }) - .catch(() => {}) - .finally(() => { if (!cancelled) setExifLoading(false) }) - return () => { cancelled = true } - }, [photo]) - const onTouchStart = (e: React.TouchEvent) => { const t = e.touches[0] touchStart.current = { x: t.clientX, y: t.clientY } @@ -112,99 +73,77 @@ export default function PhotoLightbox({ photos, startIndex = 0, onClose }: Props onTouchStart={onTouchStart} onTouchEnd={onTouchEnd} > - {/* Top bar */} -
- - {idx + 1} / {photos.length} - - -
+ {/* Photo area โ€” centered with nav overlays */} +
+ {/* Top bar */} +
+ + {idx + 1} / {photos.length} + + +
- {/* Photo */} -
+ {/* Prev button โ€” visible on hover (desktop), always visible (mobile) */} {hasPrev && ( - )} -
- {photo.caption - - {/* EXIF metadata overlay */} - {exif && !exifLoading && ( -
- {exif.camera && ( -
- - {exif.camera} -
- )} - {exif.lens && ( -
{exif.lens}
- )} - {(exif.focalLength || exif.aperture || exif.shutter || exif.iso) && ( -
- - - {[exif.focalLength, exif.aperture, exif.shutter, exif.iso ? `ISO ${exif.iso}` : ''].filter(Boolean).join(' ยท ')} - -
- )} -
- )} -
+ {/* Photo */} + {photo.caption + {/* Next button */} {hasNext && ( - )} + + {/* Caption โ€” bottom center overlay */} + {photo.caption && ( +
+

{photo.caption}

+
+ )}
- - {/* Caption */} - {photo.caption && ( -
-

{photo.caption}

-
- )}
) }