Skip to content

Commit 16ddde8

Browse files
committed
rkey as direct link + better ux on zupass gating
1 parent a16b208 commit 16ddde8

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

lib/components/event-schedule-new/atproto-to-calendar-format.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const atprotoToCalendarFormat = (event: any) => {
7171

7272
return {
7373
id: event.id,
74+
rkey: event.rkey,
7475
name: event.title,
7576
description: event.description,
7677
location: event.location.name,
@@ -104,6 +105,7 @@ export const apiResultToCalendarFormat = (atprotoEventsData: any) => {
104105
return atprotoToCalendarFormat({
105106
...record,
106107
id: event.id,
108+
rkey: event.rkey,
107109
isCoreEvent: event.is_core_event,
108110
// showTimeOfDay: updatedAfterSep3,
109111
});

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ const NewScheduleIndex = ({
199199
if (eventParam && events.length > 0) {
200200
// Try to find event by id or name (converted to slug format)
201201
const targetEvent = events.find(
202-
(event) => event.id.toString() === eventParam.toString()
202+
(event) =>
203+
event.id.toString() === eventParam.toString() ||
204+
event.rkey.toString() === eventParam.toLowerCase()
203205
);
204206

205207
if (targetEvent) {

lib/components/event-schedule-new/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface Event {
22
id: string;
3+
rkey: string;
34
name: string;
45
isFairEvent?: boolean;
56
isCoreEvent?: boolean;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ const EventVoucher = ({
248248
const couponFetchedButNoCoupon =
249249
connected && couponFetchingComplete && !coupon;
250250

251-
console.log(coupon, "coupon");
252-
253-
console.log(connectionState, "connectionState");
254-
255251
const requestCoupon = useCallback(async () => {
256252
if (connectionState !== ClientConnectionState.CONNECTED) return;
257253
if (fetchingCoupon) return;
@@ -352,7 +348,7 @@ const EventVoucher = ({
352348
color={
353349
connectionState === ClientConnectionState.CONNECTED
354350
? "green-1"
355-
: "blue-1"
351+
: "green-1"
356352
}
357353
onClick={() => {
358354
if (connectionState === ClientConnectionState.DISCONNECTED) {
@@ -430,7 +426,7 @@ const EventVoucher = ({
430426
</div>
431427
)}
432428

433-
{connectedWithNoTicket && (
429+
{!connectedWithTicket && !couponFetchedButNoCoupon && (
434430
<>
435431
<div className="text-sm font-semibold text-gray-600 mt-1">
436432
You need a Devconnect ticket to attend this event.

0 commit comments

Comments
 (0)