Skip to content

feat: enhance TransferTicketModal with link/QR code support and impro… - #73

Merged
igorihimbazwe merged 1 commit into
dev2from
fx-act
Jul 16, 2026
Merged

feat: enhance TransferTicketModal with link/QR code support and impro…#73
igorihimbazwe merged 1 commit into
dev2from
fx-act

Conversation

@igorihimbazwe

Copy link
Copy Markdown
Member

…ve user lookup functionality

Copilot AI review requested due to automatic review settings July 16, 2026 14:19
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for qiew-code-dev2 ready!

Name Link
🔨 Latest commit 1c35434
🔍 Latest deploy log https://app.netlify.com/projects/qiew-code-dev2/deploys/6a58e85d85452600085ef85a
😎 Deploy Preview https://deploy-preview-73--qiew-code-dev2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for qc-dev2 ready!

Name Link
🔨 Latest commit 1c35434
🔍 Latest deploy log https://app.netlify.com/projects/qc-dev2/deploys/6a58e85dfc04820008537f04
😎 Deploy Preview https://deploy-preview-73--qc-dev2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@igorihimbazwe
igorihimbazwe merged commit c845a8c into dev2 Jul 16, 2026
14 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances the ticket transfer flow by expanding TransferTicketModal to support selecting recipients via contacts or via pasted profile links / QR codes (camera scan or image upload), and adds supporting API helpers for recipient lookup.

Changes:

  • Add a “My contacts” vs “Link or QR” mode toggle in TransferTicketModal, including QR camera scanning and QR image decoding.
  • Implement recipient resolution/preview via /users/:id and /organizations/:id lookups, with organization-specific error messaging.
  • Simplify transferActionPurchase API payload to only include recipientId, and add getUserById / getOrganizationById helper functions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
helpers/api.ts Simplifies ticket-transfer payload and adds user/org lookup helper APIs used by the modal.
components/ActionPage/TransferTicketModal.tsx Adds link/QR recipient resolution (camera + upload) and mode toggle UI for transferring tickets beyond contacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +45
const UUID_RE = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;

const fullName = (u: RecipientUser) => `${u.firstName || ''} ${u.lastName || ''}`.trim() || u.email;
const initials = (u: RecipientUser) =>
`${(u.firstName || u.email || '?')[0] || ''}${(u.lastName || '')[0] || ''}`.toUpperCase();

/** Pull a user id out of a profile link, full URL, or raw id — QR codes encode the same link. */
const extractUserId = (input: string): string | null => {
const trimmed = input.trim();
const welcomeMatch = trimmed.match(/\/welcome\/([^/?#]+)/i);
if (welcomeMatch) return welcomeMatch[1];
const uuid = trimmed.match(UUID_RE);
return uuid ? uuid[0] : null;
};
Comment on lines +216 to +229
const handleQrFile = async (file: File) => {
try {
setResolveError(null);
setResolving(true);
const QrScanner = (await import('qr-scanner')).default;
const result = await QrScanner.scanImage(file, { returnDetailedScanResult: true });
const text = typeof result === 'string' ? result : result.data;
setLinkInput(text);
await resolveRecipient(text);
} catch {
setResolveError('Could not read a QR code from that image.');
setResolving(false);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants