mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
B91 — Mount drawer search only when expanded; unify body export
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
5ec167f8dc
commit
c73034aa77
3 changed files with 5 additions and 7 deletions
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
import { CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||
import { CampaignGlobalSearchBody, CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
|
||||
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
|
||||
import { CampaignStaffGlobalSearchBody } from '@/components/campaign/dashboard/CampaignStaffGlobalSearch'
|
||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||
import {
|
||||
HomeSearchResultsProvider,
|
||||
|
|
@ -45,7 +44,7 @@ const CampaignHomeStaffChromeInner = ({
|
|||
searchResults ? (
|
||||
<CampaignHomeStaffSearchSlot searchResults={searchResults} />
|
||||
) : (
|
||||
<CampaignStaffGlobalSearchBody />
|
||||
<CampaignGlobalSearchBody />
|
||||
)
|
||||
}
|
||||
summarySlot={summarySlot}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export const CampaignQuickActionsDrawer = ({
|
|||
) : (
|
||||
<p className="text-sm text-muted-foreground">Nenhuma ação rápida nesta página.</p>
|
||||
)}
|
||||
<CampaignGlobalSearchMount />
|
||||
{expanded ? <CampaignGlobalSearchMount /> : null}
|
||||
</div>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
|
|
|
|||
|
|
@ -34,12 +34,11 @@ describe('CampaignQuickActionsDrawer (B91)', () => {
|
|||
|
||||
render(<CampaignQuickActionsDrawer actions={[]} />)
|
||||
|
||||
const context = document.getElementById('quickActionContext')
|
||||
expect(context?.className).toContain('hidden')
|
||||
expect(context?.getAttribute('data-snap')).toBe('collapsed')
|
||||
expect(screen.queryByLabelText('Buscar na campanha')).toBeNull()
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Mostrar ações rápidas' }))
|
||||
|
||||
const context = document.getElementById('quickActionContext')
|
||||
expect(context?.className).not.toContain('hidden')
|
||||
expect(context?.getAttribute('data-snap')).toBe('expanded')
|
||||
expect(screen.getByLabelText('Buscar na campanha')).toBeTruthy()
|
||||
|
|
|
|||
Loading…
Reference in a new issue