diff --git a/frontend/src/components/gallery/GuestNamePromptModal.tsx b/frontend/src/components/gallery/GuestNamePromptModal.tsx index 95c3efd6..9e520bba 100644 --- a/frontend/src/components/gallery/GuestNamePromptModal.tsx +++ b/frontend/src/components/gallery/GuestNamePromptModal.tsx @@ -72,7 +72,7 @@ export const GuestNamePromptModal: React.FC = ({ }; return ( -
+
{allowCancel && ( diff --git a/frontend/src/components/gallery/GuestRecoveryModal.tsx b/frontend/src/components/gallery/GuestRecoveryModal.tsx index 44300d2d..1f5768eb 100644 --- a/frontend/src/components/gallery/GuestRecoveryModal.tsx +++ b/frontend/src/components/gallery/GuestRecoveryModal.tsx @@ -86,7 +86,7 @@ export const GuestRecoveryModal: React.FC = () => { }; return ( -
+
)} @@ -193,6 +219,9 @@ const MasonryPhoto: React.FC = ({ setSavedIdentity({ name, email }); setShowIdentityModal(false); if (pendingAction) { + if (pendingAction.type === 'like' && onLikeSuccess) { + onLikeSuccess(); + } await feedbackService.submitFeedback(slug!, String(pendingAction.photoId), { feedback_type: pendingAction.type, guest_name: name, @@ -249,6 +278,9 @@ export const MasonryGalleryLayout: React.FC = ({ const containerRef = useRef(null); const [columns, setColumns] = useState(3); const [containerWidth, setContainerWidth] = useState(0); + // Optimistic "I liked this" state — lifted here so it survives re-renders + // of individual MasonryPhoto components during layout reflow/resize. + const [likedPhotoIds, setLikedPhotoIds] = useState>(new Set()); const gallerySettings = theme.gallerySettings || {}; const gutter = gallerySettings.masonryGutter || 16; const mode = gallerySettings.masonryMode || 'columns'; @@ -798,6 +830,14 @@ export const MasonryGalleryLayout: React.FC = ({ feedbackOptions={feedbackOptions} onQuickComment={() => onOpenPhotoWithFeedback && onOpenPhotoWithFeedback(originalIndex)} columnWidth={columnWidth} + liked={likedPhotoIds.has(photo.id)} + onLikeSuccess={() => { + setLikedPhotoIds((prev) => { + const next = new Set(prev); + next.add(photo.id); + return next; + }); + }} /> ); })}