feat: add TransferTicketModal component for ticket transfers - #72
Merged
Conversation
igorihimbazwe
commented
Jul 16, 2026
Member
- Implemented TransferTicketModal for transferring tickets to contacts.
- Integrated contact search functionality using useGetAcceptedContactsQuery.
- Added error handling and success notifications with toast messages.
- Created a new ImageCarousel component for displaying images in a carousel format.
- Enhanced VoteModal with ImageCarousel and SocialLinksRow for better candidate presentation.
- Introduced ShareQrDialog for sharing QR codes with copy and download options.
- Added SocialLinksRow component to display social media links in a user-friendly manner.
- Updated API helpers to include transferActionPurchase function for ticket transfers.
- Extended action types to include SocialLinks and SubActionMetadata for better metadata handling.
- Implemented utility function parseMetadata for normalizing sub-action metadata.
- Implemented TransferTicketModal for transferring tickets to contacts. - Integrated contact search functionality using useGetAcceptedContactsQuery. - Added error handling and success notifications with toast messages. - Created a new ImageCarousel component for displaying images in a carousel format. - Enhanced VoteModal with ImageCarousel and SocialLinksRow for better candidate presentation. - Introduced ShareQrDialog for sharing QR codes with copy and download options. - Added SocialLinksRow component to display social media links in a user-friendly manner. - Updated API helpers to include transferActionPurchase function for ticket transfers. - Extended action types to include SocialLinks and SubActionMetadata for better metadata handling. - Implemented utility function parseMetadata for normalizing sub-action metadata.
✅ Deploy Preview for qiew-code-dev2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for qc-dev2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds ticket-transfer UX and expands action/sub-action presentation (vote candidates, sub-action detail pages) with richer media (image carousels/lightbox), shareable QR dialogs, and normalized sub-action metadata handling for legacy rows.
Changes:
- Added
TransferTicketModaland an API helper to transfer purchased tickets to accepted contacts. - Introduced reusable UI components:
ImageCarousel,ImageLightbox,ShareQrDialog, andSocialLinksRow. - Extended sub-action typing/metadata handling (
images,socialLinks) and addedparseMetadatato normalize legacy/double-encoded metadata.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/subActionMetadata.ts | Adds parseMetadata to normalize legacy JSON/string metadata before use. |
| types/action.types.ts | Extends sub-action types to include socialLinks metadata and images. |
| INTEGRATION_AUDIT.md | Adds an integration audit tracking frontend/backend gaps. |
| helpers/api.ts | Adds transferActionPurchase helper for ticket transfers. |
| components/ui/social-links.tsx | New UI row for Instagram/X links used across candidate/sub-action UIs. |
| components/ui/share-qr-dialog.tsx | New dialog for sharing QR/link with copy/share/download actions. |
| components/ui/image-lightbox.tsx | New fullscreen viewer for photo galleries with keyboard/swipe navigation. |
| components/ui/image-carousel.tsx | New carousel component + collectImages helper for cover/gallery images. |
| components/ActionPage/TransferTicketModal.tsx | New modal to search contacts and transfer a ticket purchase. |
| components/ActionPage/ActionWizardModal.tsx | Enhances sub-action creation/editing with gallery images + social links + edit mode. |
| components/action-modals/VoteModal.tsx | Enhances candidate presentation with carousel + social links. |
| components/action-modals/types.ts | Extends modal sub-action typing for images and socialLinks. |
| app/welcome/[userId]/action/[actionId]/page.tsx | Adds carousel/social links/QR share for vote candidates and sub-actions. |
| app/action/[userId]/subactions/[subactionId]/page.tsx | Adds carousel/lightbox/share UX and normalizes metadata rendering. |
| app/action/[userId]/page.tsx | Adds transfer UI entry points and action preview affordances. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+68
to
+72
| <a | ||
| key={entry.key} | ||
| href={entry.href} | ||
| target="_blank" | ||
| rel="noopener noreferrer nofollow" |
Comment on lines
+22
to
+43
| const go = useCallback( | ||
| (direction: 1 | -1) => { | ||
| onIndexChange((index + direction + images.length) % images.length); | ||
| }, | ||
| [index, images.length, onIndexChange] | ||
| ); | ||
|
|
||
| useEffect(() => { | ||
| const onKey = (e: KeyboardEvent) => { | ||
| if (e.key === 'Escape') onClose(); | ||
| if (e.key === 'ArrowRight') go(1); | ||
| if (e.key === 'ArrowLeft') go(-1); | ||
| }; | ||
| window.addEventListener('keydown', onKey); | ||
| // Freeze the page behind the overlay | ||
| const previousOverflow = document.body.style.overflow; | ||
| document.body.style.overflow = 'hidden'; | ||
| return () => { | ||
| window.removeEventListener('keydown', onKey); | ||
| document.body.style.overflow = previousOverflow; | ||
| }; | ||
| }, [go, onClose]); |
Comment on lines
+860
to
+869
| const addGalleryFiles = useCallback((files: File[]) => { | ||
| setGalleryFiles((prev) => [...prev, ...files].slice(0, MAX_GALLERY_IMAGES)); | ||
| files.forEach((file) => { | ||
| const reader = new FileReader(); | ||
| reader.onloadend = () => { | ||
| setGalleryPreviews((prev) => [...prev, reader.result as string]); | ||
| }; | ||
| reader.readAsDataURL(file); | ||
| }); | ||
| }, []); |
Comment on lines
+47
to
+49
| const { data, isLoading, error } = useGetAcceptedContactsQuery(token as string, { | ||
| skip: !token || !open, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.