From 5abc0e08816e883674b0b6b0d5e1ae2e071a8339 Mon Sep 17 00:00:00 2001 From: fsolla Date: Mon, 10 Aug 2026 03:22:21 -0300 Subject: [PATCH] fix(C103): reaplica timeVisible/allDay do C104 perdidos no ciclo de rebase --- .../activity/ActivityDateTimeField.tsx | 73 +++++++++++-------- .../activity/ActivityInlineCreate.tsx | 61 ++++++++++++++-- 2 files changed, 96 insertions(+), 38 deletions(-) diff --git a/src/components/campaign/activity/ActivityDateTimeField.tsx b/src/components/campaign/activity/ActivityDateTimeField.tsx index d954b166..9a3ab854 100644 --- a/src/components/campaign/activity/ActivityDateTimeField.tsx +++ b/src/components/campaign/activity/ActivityDateTimeField.tsx @@ -18,6 +18,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover import { floorToMinuteStep, formatBahiaCivilDate, + formatBahiaCivilDateLabel, formatBahiaCivilDateTimeLabel, hourOptions, minuteOptionsForStep, @@ -37,6 +38,9 @@ import { cn } from '@/lib/utils' * C103 — on narrow viewports the picker opens as a nested bottom sheet * (calendar + hour/minute fully on screen, "Pronto" applies and closes), * keeping the desktop popover untouched. + * + * C104 — `timeVisible={false}` is the all-day mode: the trigger formats only + * the date and the picker renders just the calendar (no time selects). */ export const ActivityDateTimeField = ({ id, @@ -47,6 +51,7 @@ export const ActivityDateTimeField = ({ isNarrow = false, label, required = false, + timeVisible = true, }: { id: string value: string @@ -60,6 +65,8 @@ export const ActivityDateTimeField = ({ label?: string /** Marks the required fields with a visible asterisk on the narrow trigger. */ required?: boolean + /** When false, hide the time selects and label the trigger with the date only. */ + timeVisible?: boolean }) => { const [open, setOpen] = useState(false) const civil = floorToMinuteStep(value) @@ -96,7 +103,9 @@ export const ActivityDateTimeField = ({ 'border-destructive ring-3 ring-destructive/20 focus-visible:border-destructive focus-visible:ring-destructive/20', )} > - {formatBahiaCivilDateTimeLabel(civil)} + + {timeVisible ? formatBahiaCivilDateTimeLabel(civil) : formatBahiaCivilDateLabel(civil)} + {isNarrow && required ? (