teqo/src/components/campaign/activity/AgendaPeriodChrome.tsx
Francisco Solla 51fb715ec7 feat(C101): agenda mobile com cara de app nativo — contexto no header, swipe, filtro sticky, dia na hora atual
- toolbar do FullCalendar some no mobile; título do header mostra o período
  ("9 Agosto", "3–9 Agosto", "Agosto", "Agenda") e tap volta ao hoje
- navegação por arrasto horizontal (useAgendaSwipeNavigation): limiar 48px,
  claim 12px com preventDefault, touchcancel sintético contra o long-press
  do FC, dateClick do dia suprimido (C91/C15 intactos)
- filtro vira strip edge-to-edge sem rótulo, sticky sob a barra do app
  (containing block via :has no padding do scroll container)
- visão de dia com scroll interno (height fixa), 08:00 na abertura,
  cabeçalho do dia fixo, scroll preservado ao trocar de dia
- desktop inalterado; impl plan + plano pós-critique (C101-ux)
2026-08-09 22:09:47 -03:00

31 lines
931 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client'
import { useMemo } from 'react'
import { SetCampaignPageChrome } from '@/components/campaign/shell/CampaignPageChromeContext'
/**
* C101 — agenda page → app header bridge for the period context: while the
* mobile calendar navigates, the top bar title shows the visible period
* ("9 Agosto", "3–9 Agosto", "Agosto") instead of the catalog "Agenda", and
* tapping it returns to today (the "Hoje" toolbar button is hidden on
* phones). Desktop never mounts this — the agenda only renders it when the
* mobile top bar is the visible chrome.
*/
export const AgendaPeriodChrome = ({
label,
onToday,
}: {
label: string | null
onToday: () => void
}) => {
const chrome = useMemo(
() =>
label ? { title: label, onTitleClick: { action: onToday, hint: 'Voltar para hoje' } } : null,
[label, onToday],
)
if (!chrome) return null
return <SetCampaignPageChrome chrome={chrome} />
}