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