refactor(guest): retire legacy guest app and move shared modules
This commit is contained in:
@@ -2,9 +2,9 @@ import { Theme } from '@tamagui/core';
|
||||
import React from 'react';
|
||||
import type { Appearance } from '@/hooks/use-appearance';
|
||||
import { useAppearance } from '@/hooks/use-appearance';
|
||||
import { useEventBranding } from '@/guest/context/EventBrandingContext';
|
||||
import { relativeLuminance } from '@/guest/lib/color';
|
||||
import type { EventBranding } from '@/guest/types/event-branding';
|
||||
import { useEventBranding } from '@/shared/guest/context/EventBrandingContext';
|
||||
import { relativeLuminance } from '@/shared/guest/lib/color';
|
||||
import type { EventBranding } from '@/shared/guest/types/event-branding';
|
||||
|
||||
const LIGHT_LUMINANCE_THRESHOLD = 0.65;
|
||||
const DARK_LUMINANCE_THRESHOLD = 0.35;
|
||||
|
||||
20
resources/js/guest-v2/lib/cachePolicy.ts
Normal file
20
resources/js/guest-v2/lib/cachePolicy.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export function shouldCacheResponse(response: Response | null): boolean {
|
||||
if (!response) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const cacheControl = response.headers.get('Cache-Control') ?? '';
|
||||
const pragma = response.headers.get('Pragma') ?? '';
|
||||
const normalizedCacheControl = cacheControl.toLowerCase();
|
||||
const normalizedPragma = pragma.toLowerCase();
|
||||
|
||||
if (normalizedCacheControl.includes('no-store') || normalizedCacheControl.includes('private')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (normalizedPragma.includes('no-cache')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { EventBranding } from '@/guest/types/event-branding';
|
||||
import type { EventBrandingPayload } from '@/guest/services/eventApi';
|
||||
import type { EventBranding } from '@/shared/guest/types/event-branding';
|
||||
import type { EventBrandingPayload } from '@/shared/guest/services/eventApi';
|
||||
|
||||
export function mapEventBranding(raw?: EventBrandingPayload | null): EventBranding | null {
|
||||
if (!raw) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DEFAULT_EVENT_BRANDING, useOptionalEventBranding } from '@/guest/context/EventBrandingContext';
|
||||
import type { EventBranding } from '@/guest/types/event-branding';
|
||||
import { DEFAULT_EVENT_BRANDING, useOptionalEventBranding } from '@/shared/guest/context/EventBrandingContext';
|
||||
import type { EventBranding } from '@/shared/guest/types/event-branding';
|
||||
import { useAppearance, type Appearance } from '@/hooks/use-appearance';
|
||||
import { resolveGuestThemeName } from './brandingTheme';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user