B106 — format
This commit is contained in:
parent
d4a7b448ad
commit
f80f672732
6 changed files with 26 additions and 25 deletions
|
|
@ -78,30 +78,30 @@ export default async function CampaignAppLayout({ children }: { children: React.
|
|||
<CampaignWizardChromeProvider>
|
||||
<CampaignHomeSearchChromeProvider>
|
||||
<CampaignQuickActionContextProvider>
|
||||
<CampaignListPendingBoundary>
|
||||
<CampaignMobileTopBar
|
||||
notificationBell={<CampaignNotificationBellSlot user={user} />}
|
||||
/>
|
||||
<header className="hidden min-h-11 shrink-0 items-center gap-2 border-b border-border px-4 md:flex print:hidden">
|
||||
<SidebarTrigger />
|
||||
<div className="ml-auto">
|
||||
<CampaignNotificationBellSlot user={user} />
|
||||
</div>
|
||||
</header>
|
||||
{/*
|
||||
<CampaignListPendingBoundary>
|
||||
<CampaignMobileTopBar
|
||||
notificationBell={<CampaignNotificationBellSlot user={user} />}
|
||||
/>
|
||||
<header className="hidden min-h-11 shrink-0 items-center gap-2 border-b border-border px-4 md:flex print:hidden">
|
||||
<SidebarTrigger />
|
||||
<div className="ml-auto">
|
||||
<CampaignNotificationBellSlot user={user} />
|
||||
</div>
|
||||
</header>
|
||||
{/*
|
||||
Provider must wrap CampaignAppScrollChrome, not only page children:
|
||||
the mobile quick-actions drawer (B91/B100) mounts as a sibling of
|
||||
the scrollport and renders search hits with CampaignHoverTooltip
|
||||
(priority flag). Nested only around {children} left focus→suggest
|
||||
without a provider and crashed the page (B102).
|
||||
*/}
|
||||
<TooltipProvider delayDuration={300}>
|
||||
<CampaignAppScrollChrome role={user.role}>{children}</CampaignAppScrollChrome>
|
||||
</TooltipProvider>
|
||||
<Toaster position="top-center" />
|
||||
<InstallPwaToast />
|
||||
{biometricEnrollment ? <BiometricEnrollmentToast {...biometricEnrollment} /> : null}
|
||||
</CampaignListPendingBoundary>
|
||||
<TooltipProvider delayDuration={300}>
|
||||
<CampaignAppScrollChrome role={user.role}>{children}</CampaignAppScrollChrome>
|
||||
</TooltipProvider>
|
||||
<Toaster position="top-center" />
|
||||
<InstallPwaToast />
|
||||
{biometricEnrollment ? <BiometricEnrollmentToast {...biometricEnrollment} /> : null}
|
||||
</CampaignListPendingBoundary>
|
||||
</CampaignQuickActionContextProvider>
|
||||
</CampaignHomeSearchChromeProvider>
|
||||
</CampaignWizardChromeProvider>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import {
|
|||
} from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
|
||||
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
|
||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||
import { CampaignHomeSearchChromePublisher } from '@/components/campaign/dashboard/CampaignHomeSearchChromePublisher'
|
||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||
import {
|
||||
HomeSearchResultsProvider,
|
||||
InitialHomeSearchSuggestProvider,
|
||||
|
|
|
|||
|
|
@ -3,16 +3,15 @@
|
|||
import type { ReactNode } from 'react'
|
||||
|
||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||
import { HomeSearchSuggestSkeleton } from '@/components/campaign/dashboard/HomeSearchSuggestSkeleton'
|
||||
import { useHomeSearchResults } from '@/components/campaign/dashboard/HomeSearchResultsContext'
|
||||
import { HomeSearchSuggestSkeleton } from '@/components/campaign/dashboard/HomeSearchSuggestSkeleton'
|
||||
import { homeSearchHasAnyHits } from '@/lib/campaignHomeSearchHits'
|
||||
|
||||
export const HomeSearchResultsShell = ({ children }: { children: ReactNode }) => {
|
||||
const { query } = useHomeSearch()
|
||||
const { results, resultKind, isFetching } = useHomeSearchResults()
|
||||
|
||||
const hasRenderableHits =
|
||||
results.status === 'success' && homeSearchHasAnyHits(results.data)
|
||||
const hasRenderableHits = results.status === 'success' && homeSearchHasAnyHits(results.data)
|
||||
const showSkeleton = isFetching && !hasRenderableHits && results.status !== 'error'
|
||||
|
||||
const showEmpty =
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ import { useCampaignWizardChrome } from '@/components/campaign/shell/CampaignWiz
|
|||
import { Button } from '@/components/ui/button'
|
||||
import { SidebarTrigger } from '@/components/ui/Sidebar'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { HOME_SEARCH_COLLAPSE_ARIA_LABEL } from '@/lib/campaignHomeSearchContract'
|
||||
import {
|
||||
WIZARD_APP_TOP_BAR_ARIA_LABEL,
|
||||
WIZARD_DISMISS_ARIA_LABEL,
|
||||
wizardFlowChromeAriaLabel,
|
||||
wizardMunicipalityChromeAriaLabel,
|
||||
} from '@/lib/campaignWizardCopy'
|
||||
import { HOME_SEARCH_COLLAPSE_ARIA_LABEL } from '@/lib/campaignHomeSearchContract'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const wizardNavButtonClass =
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ export type HomeSearchFocusHistoryState = {
|
|||
[HOME_SEARCH_FOCUS_HISTORY_KEY]?: true
|
||||
}
|
||||
|
||||
export const isHomeSearchFocusHistoryState = (state: unknown): state is HomeSearchFocusHistoryState =>
|
||||
export const isHomeSearchFocusHistoryState = (
|
||||
state: unknown,
|
||||
): state is HomeSearchFocusHistoryState =>
|
||||
typeof state === 'object' &&
|
||||
state !== null &&
|
||||
HOME_SEARCH_FOCUS_HISTORY_KEY in state &&
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ vi.mock('next/navigation', () => ({
|
|||
}),
|
||||
}))
|
||||
|
||||
import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar'
|
||||
import {
|
||||
CampaignHomeSearchChromeProvider,
|
||||
useSetCampaignHomeSearchChrome,
|
||||
type CampaignHomeSearchChromeState,
|
||||
} from '@/components/campaign/shell/CampaignHomeSearchChromeContext'
|
||||
import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar'
|
||||
import {
|
||||
CampaignWizardChromeProvider,
|
||||
useSetCampaignWizardChrome,
|
||||
|
|
|
|||
Loading…
Reference in a new issue