diff --git a/src/client/components/OfficeFloorMap.tsx b/src/client/components/OfficeFloorMap.tsx index 4f6827f5..2a49368f 100644 --- a/src/client/components/OfficeFloorMap.tsx +++ b/src/client/components/OfficeFloorMap.tsx @@ -33,12 +33,14 @@ const PointComponent: Record< disabled={!isAvailable} color={isSelected ? 'purple' : 'default'} className={cn( + pointCommonStyle, isSelected ? 'border-pink-600 bg-accents-pink' : 'bg-violet-300 border-violet-300', - 'hover:bg-cta-purple hover:border-cta-hover-purpleNoOpacity hover:text-white', - 'min-h-[32px] min-w-[32px]', - pointCommonStyle + isAvailable + ? 'hover:bg-cta-purple hover:border-cta-hover-purpleNoOpacity hover:text-white' + : 'hover:scale-100 hover:bg-violet-300', + 'min-h-[32px] min-w-[32px]' )} onClick={onClick(item.id, VisitType.Visit)} > diff --git a/src/modules/hub-map/client/components/HubMap.tsx b/src/modules/hub-map/client/components/HubMap.tsx index 2119bf2b..20cfc42e 100644 --- a/src/modules/hub-map/client/components/HubMap.tsx +++ b/src/modules/hub-map/client/components/HubMap.tsx @@ -1,5 +1,11 @@ import * as React from 'react' -import { Avatar, Input, Select, WidgetWrapper } from '#client/components/ui' +import { + Avatar, + Input, + Select, + StealthMode, + WidgetWrapper, +} from '#client/components/ui' import { useStore } from '@nanostores/react' import * as stores from '#client/stores' import { useOffice } from '#client/utils/hooks' @@ -11,6 +17,7 @@ import { ScheduledItemsList } from './ScheduledItemsList' import { useAvailableDesks, useOfficeVisitors, + useToggleStealthMode, useVisitsAreas, } from '#modules/visits/client/queries' import { propEq } from '#shared/utils' @@ -51,6 +58,14 @@ export const _HubMap = () => { dayjs().toString() ) + const { mutate: toggleStealthMode } = useToggleStealthMode(() => { + refetchVisits() + refetchVisitors() + }) + const onToggleStealthMode = React.useCallback((value: boolean) => { + toggleStealthMode({ stealthMode: value }) + }, []) + React.useEffect(() => { setOfficeVisits(upcomingVisitsAll?.byDate[date.format(DATE_FORMAT)]) }, [upcomingVisitsAll?.byDate, date]) @@ -74,7 +89,7 @@ export const _HubMap = () => { [] ) - const { data: visitors } = useOfficeVisitors( + const { data: visitors, refetch: refetchVisitors } = useOfficeVisitors( officeId, dayjs(date).format(DATE_FORMAT) ) @@ -226,6 +241,13 @@ export const _HubMap = () => { }} /> +