Skip to content

Commit 7ba727f

Browse files
committed
slightly improved messaging + log zupass connection errors
1 parent 602e373 commit 7ba727f

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

  • lib/components/event-schedule-new/zupass

lib/components/event-schedule-new/zupass/zupass.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { pod, PODData } from "@parcnet-js/podspec";
1616
import { POD } from "@pcd/pod";
1717
import { eventShops } from "./event-shops-list";
1818
import { Info, ArrowRight } from "lucide-react";
19+
import cn from "classnames";
1920

2021
// HOC to wrap ParcnetClientProvider
2122
export const withParcnetProvider = <P extends object>(
@@ -316,6 +317,18 @@ const EventVoucher = ({
316317
}
317318
}, [connectionState, fetchingCoupon, ticketVerified]);
318319

320+
useEffect(() => {
321+
if (connectionState === ClientConnectionState.ERROR) {
322+
// LOG MATOMO ERROR
323+
// @ts-ignore
324+
const matomo = window && window._paq;
325+
326+
if (matomo) {
327+
matomo.push(["trackEvent", "Zupass Connection Error"]);
328+
}
329+
}
330+
}, [connectionState]);
331+
319332
return (
320333
<div className="w-full max-w-md mx-auto flex gap-2 flex-col">
321334
{/* Header */}
@@ -346,7 +359,9 @@ const EventVoucher = ({
346359
size="sm"
347360
className="outline-none w-[150px]"
348361
color={
349-
connectionState === ClientConnectionState.CONNECTED
362+
connectionState === "ERROR"
363+
? "red-1"
364+
: connectionState === ClientConnectionState.CONNECTED
350365
? "green-1"
351366
: "green-1"
352367
}
@@ -375,7 +390,7 @@ const EventVoucher = ({
375390
{connectionState === ClientConnectionState.DISCONNECTED &&
376391
"Connect Zupass"}
377392
{connectionState === ClientConnectionState.ERROR &&
378-
"Connection Failed"}
393+
"Connection Error"}
379394
</div>
380395
</VoxelButton>
381396
</div>
@@ -428,9 +443,13 @@ const EventVoucher = ({
428443

429444
{!connectedWithTicket && !couponFetchedButNoCoupon && (
430445
<>
431-
<div className="text-sm font-semibold text-gray-600 mt-1">
446+
<div
447+
className={cn("text-sm font-semibold text-gray-600 mt-1", {
448+
"text-red-600": connectedWithNoTicket,
449+
})}
450+
>
432451
{connectedWithNoTicket
433-
? "No Devconnect ticket found"
452+
? "No Devconnect ticket found, get one below:"
434453
: "You need a Devconnect ticket to attend this event."}
435454
</div>
436455
<VoxelButton

0 commit comments

Comments
 (0)