upgrade to tamagui v2 and guest pwa overhaul
This commit is contained in:
16
resources/js/guest-v2/services/eventLink.ts
Normal file
16
resources/js/guest-v2/services/eventLink.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { EventData } from './eventApi';
|
||||
|
||||
export function buildEventShareLink(event: EventData | null, token: string | null): string {
|
||||
if (typeof window === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
|
||||
const origin = window.location.origin;
|
||||
const eventToken = token ?? event?.join_token ?? '';
|
||||
|
||||
if (!eventToken) {
|
||||
return origin;
|
||||
}
|
||||
|
||||
return `${origin}/e/${encodeURIComponent(eventToken)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user