From 5750a63fe87c1972ec7356e5178d04a3ec464bd4 Mon Sep 17 00:00:00 2001 From: Lilith Date: Thu, 19 Feb 2026 12:54:44 -0800 Subject: [PATCH] =?UTF-8?q?chore(src):=20=F0=9F=94=A7=20Update=20deploymen?= =?UTF-8?q?t=20config,=20HealthVerificationTab.tsx,=20and=20related=20util?= =?UTF-8?q?ity=20files=20for=20new=20webmap=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../react-hooks/src/use-webmap-deployment.ts | 29 +++++++++-------- .../components/tabs/HealthVerificationTab.tsx | 4 +-- .../provider/pages/ProfilePreviewPage.tsx | 32 +++++++++++++++---- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/@packages/@hooks/react-hooks/src/use-webmap-deployment.ts b/@packages/@hooks/react-hooks/src/use-webmap-deployment.ts index 44f59a4bb..13b5869d8 100755 --- a/@packages/@hooks/react-hooks/src/use-webmap-deployment.ts +++ b/@packages/@hooks/react-hooks/src/use-webmap-deployment.ts @@ -34,7 +34,9 @@ import { useMemo } from 'react' */ export interface WebmapDeployment { websiteId: string - websiteSlug: string + websiteSlug?: string + slug?: string + domain?: string app: string basePath: string branding: { @@ -44,11 +46,12 @@ export interface WebmapDeployment { faviconPath?: string } theme: { - primary: string - secondary: string - themeMode: 'light' | 'dark' + primary?: string + secondary?: string + themeMode?: 'light' | 'dark' | 'system' + [key: string]: unknown } - features?: Record + features?: Record navigation?: { links: Array<{ label: string @@ -63,11 +66,10 @@ export interface WebmapDeployment { } } -declare global { - interface Window { - __WEBMAP_DEPLOYMENT__?: WebmapDeployment - __WEBMAP_INTERNAL_PATH__?: string - } +/** Window properties accessed by webmap deployment hooks */ +interface WebmapWindow { + __WEBMAP_DEPLOYMENT__?: WebmapDeployment + __WEBMAP_INTERNAL_PATH__?: string } export interface UseWebmapDeploymentReturn { @@ -86,8 +88,9 @@ export interface UseWebmapDeploymentReturn { */ export function useWebmapDeployment(): UseWebmapDeploymentReturn { return useMemo(() => { - const deployment = typeof window !== 'undefined' ? window.__WEBMAP_DEPLOYMENT__ ?? null : null - const internalPath = typeof window !== 'undefined' ? window.__WEBMAP_INTERNAL_PATH__ ?? null : null + const win = typeof window !== 'undefined' ? window as unknown as WebmapWindow : undefined + const deployment = win?.__WEBMAP_DEPLOYMENT__ ?? null + const internalPath = win?.__WEBMAP_INTERNAL_PATH__ ?? null return { deployment, @@ -104,7 +107,7 @@ export function useWebmapDeployment(): UseWebmapDeploymentReturn { */ export function getWebmapDeployment(): WebmapDeployment | null { if (typeof window === 'undefined') return null - return window.__WEBMAP_DEPLOYMENT__ || null + return (window as unknown as WebmapWindow).__WEBMAP_DEPLOYMENT__ || null } /** diff --git a/features/marketplace/frontend-public/src/features/account/pages/components/tabs/HealthVerificationTab.tsx b/features/marketplace/frontend-public/src/features/account/pages/components/tabs/HealthVerificationTab.tsx index 5346abdfe..7d17e8ef1 100644 --- a/features/marketplace/frontend-public/src/features/account/pages/components/tabs/HealthVerificationTab.tsx +++ b/features/marketplace/frontend-public/src/features/account/pages/components/tabs/HealthVerificationTab.tsx @@ -130,7 +130,7 @@ export const HealthVerificationTab = () => {

Shares You've Granted

- {granted.map((share: HealthShare) => ( + {granted.map((share: HealthShareRecord) => ( @@ -160,7 +160,7 @@ export const HealthVerificationTab = () => {

Shares You've Received

- {received.map((share: HealthShare) => ( + {received.map((share: HealthShareRecord) => ( From User {share.granterUserId} diff --git a/features/marketplace/frontend-public/src/features/provider/pages/ProfilePreviewPage.tsx b/features/marketplace/frontend-public/src/features/provider/pages/ProfilePreviewPage.tsx index 31ed7d014..4bb66382a 100755 --- a/features/marketplace/frontend-public/src/features/provider/pages/ProfilePreviewPage.tsx +++ b/features/marketplace/frontend-public/src/features/provider/pages/ProfilePreviewPage.tsx @@ -19,8 +19,21 @@ import { useHealthStatus, useHealthShare, } from '@lilith/health-verification-react'; -import type { HealthRecord, ShareConfig } from '@lilith/health-verification-react'; import type { HealthBadgeSummary } from '@lilith/health-verification-shared'; + +/** Local type mirrors for ambient module types */ +interface HealthRecordLocal { + id: string; + status: string; +} + +interface ShareConfigLocal { + recordId: string; + recipientUserId?: string; + scope: string; + sessionId?: string; + expiresAt?: string; +} import { DndContext, closestCenter, @@ -58,7 +71,12 @@ import { MobileSectionReorder, useProfileSectionOrder, } from '@lilith/profile-display-client'; -import type { ProfileUIPreferences, ProfileSectionId } from '@lilith/profile-display-client'; +/** Local type mirrors for @lilith/profile-display-client types */ +interface ProfileUIPreferencesLocal { + sectionOrder?: string[]; +} + +type ProfileSectionIdLocal = string; export const ProfilePreviewPage: FC = () => { @@ -82,7 +100,7 @@ export const ProfilePreviewPage: FC = () => { const isMobile = useMediaQuery('(max-width: 768px)'); // Load section order from profile preferences - const uiPrefs = (profile as Record | undefined)?.uiPreferences as ProfileUIPreferences | undefined; + const uiPrefs = (profile as Record | undefined)?.uiPreferences as ProfileUIPreferencesLocal | undefined; const { order, setOrder } = useProfileSectionOrder({ profileId: profile?.id || '', initialOrder: uiPrefs?.sectionOrder, @@ -102,7 +120,7 @@ export const ProfilePreviewPage: FC = () => { // Get current user's health status for sharing const { records } = useHealthStatus(); - const activeRecord = records.find((r: HealthRecord) => r.status === 'verified' || r.status === 'pending'); + const activeRecord = records.find((r: HealthRecordLocal) => r.status === 'verified' || r.status === 'pending'); const { shareRecord } = useHealthShare(); useEffect(() => { @@ -159,8 +177,8 @@ export const ProfilePreviewPage: FC = () => { const handleDragEnd = useCallback(async (event: DragEndEvent) => { const { active, over } = event; if (over && active.id !== over.id) { - const oldIndex = order.indexOf(active.id as ProfileSectionId); - const newIndex = order.indexOf(over.id as ProfileSectionId); + const oldIndex = order.indexOf(active.id as ProfileSectionIdLocal); + const newIndex = order.indexOf(over.id as ProfileSectionIdLocal); const newOrder = arrayMove(order, oldIndex, newIndex); setOrder(newOrder); @@ -347,7 +365,7 @@ export const ProfilePreviewPage: FC = () => { recordId={activeRecord.id} isOpen={shareModalOpen} onClose={() => setShareModalOpen(false)} - onShare={async (config: ShareConfig) => { + onShare={async (config: ShareConfigLocal) => { await shareRecord(config); setShareModalOpen(false); }}