fix(coss-ui): convert /settings/my-account/general to coss-ui (#26053)
* fix(coss-ui): convert /settings/my-account/general to coss-ui * update guide * fix: add menuPosition fixed to TimezoneSelect in TravelScheduleModal Co-Authored-By: [email protected] <[email protected]> * fix: use menuPortalTarget to render TimezoneSelect dropdown above dialog footer Co-Authored-By: [email protected] <[email protected]> * fix: use Object.assign for type-safe styles in TimezoneSelect Co-Authored-By: [email protected] <[email protected]> * revert comment * fix: guard document access for SSR in TravelScheduleModal Addresses Cubic AI review feedback: menuPortalTarget={document.body} will throw during server rendering where document is undefined. Added typeof check to guard against SSR. Co-Authored-By: unknown <> * change dialog backdrop from blur to dim * fix: add menuPlacement auto to open dropdown upward on mobile Co-Authored-By: [email protected] <[email protected]> * fix: use menuPlacement top on mobile for TimezoneSelect dropdown Co-Authored-By: [email protected] <[email protected]> * fix: make timezone button stack vertically on mobile to prevent overflow Co-Authored-By: [email protected] <[email protected]> * fix: make timezone select and button 50/50 width on larger viewports Co-Authored-By: [email protected] <[email protected]> * fix date range picker issue on mobile * prevent travel schedule dialog dismissal with date picker --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
7 files changed
+1195
-83
No files matched your search
@@ -1,11 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import classNames from "@calcom/ui/classNames";
|
||||
import * as Popover from "@radix-ui/react-popover";
|
||||
import { format, isBefore, isSameDay } from "date-fns";
|
||||
import { useState, useMemo, type HTMLAttributes } from "react";
|
||||
|
||||
import classNames from "@calcom/ui/classNames";
|
||||
|
||||
import { type HTMLAttributes, useMemo, useState } from "react";
|
||||
import { Button } from "../../button";
|
||||
import { Calendar } from "./Calendar";
|
||||
import { calculateNewDateRange } from "./dateRangeLogic";
|
||||
@@ -17,6 +15,9 @@ type DatePickerWithRangeProps = {
|
||||
minDate?: Date | null;
|
||||
maxDate?: Date;
|
||||
withoutPopover?: boolean;
|
||||
popoverModal?: boolean;
|
||||
popoverOpen?: boolean;
|
||||
onPopoverOpenChange?: (open: boolean) => void;
|
||||
"data-testid"?: string;
|
||||
strictlyBottom?: boolean;
|
||||
allowPastDates?: boolean;
|
||||
@@ -30,6 +31,9 @@ export function DatePickerWithRange({
|
||||
onDatesChange,
|
||||
disabled,
|
||||
withoutPopover,
|
||||
popoverModal = true,
|
||||
popoverOpen,
|
||||
onPopoverOpenChange,
|
||||
"data-testid": testId,
|
||||
strictlyBottom,
|
||||
allowPastDates = false,
|
||||
@@ -56,7 +60,7 @@ export function DatePickerWithRange({
|
||||
setHoveredDate(undefined);
|
||||
}
|
||||
|
||||
const fromDate = allowPastDates && minDate === null ? undefined : minDate ?? new Date();
|
||||
const fromDate = allowPastDates && minDate === null ? undefined : (minDate ?? new Date());
|
||||
|
||||
const hoverRangeModifier = useMemo(() => {
|
||||
if (!dates.startDate || dates.endDate || !hoveredDate) {
|
||||
@@ -97,7 +101,7 @@ export function DatePickerWithRange({
|
||||
return (
|
||||
<div className={classNames("grid gap-2", className)}>
|
||||
{/* modal prop required for iOS compatibility when nested inside Dialog modals */}
|
||||
<Popover.Root modal>
|
||||
<Popover.Root modal={popoverModal} open={popoverOpen} onOpenChange={onPopoverOpenChange}>
|
||||
<Popover.Trigger asChild>
|
||||
<Button
|
||||
data-testid="date-range"
|
||||
|
||||
Reference in new issue
Block a user