fix: insights UI/UX (#16610)
* remove old code remnant * - * WIP * type change * -- * typefix * fix type * fix type * change type name * add basewhere to eventsByStatus * add basewhere to the rest * fix rendering null popular event list item * URL params for start and endtime to have YYYY-MM-DD format * remove console log * resolve suggestion --------- Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
1 parent
2872b263fd
commit
38fa0fae1d
10 files changed
+425
-785
No files matched your search
@@ -11,10 +11,18 @@ import { buttonClasses } from "../../button/Button";
|
||||
|
||||
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
||||
|
||||
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
|
||||
function Calendar({
|
||||
className,
|
||||
classNames,
|
||||
fromDate,
|
||||
toDate,
|
||||
showOutsideDays = true,
|
||||
...props
|
||||
}: CalendarProps) {
|
||||
return (
|
||||
<DayPicker
|
||||
fromDate={new Date()}
|
||||
fromDate={fromDate || new Date()}
|
||||
toDate={toDate || undefined}
|
||||
showOutsideDays={showOutsideDays}
|
||||
className={cn("p-3", className)}
|
||||
classNames={{
|
||||
|
||||
@@ -14,11 +14,15 @@ type DatePickerWithRangeProps = {
|
||||
dates: { startDate: Date; endDate?: Date };
|
||||
onDatesChange: ({ startDate, endDate }: { startDate?: Date; endDate?: Date }) => void;
|
||||
disabled?: boolean;
|
||||
minDate?: Date;
|
||||
maxDate?: Date;
|
||||
};
|
||||
|
||||
export function DatePickerWithRange({
|
||||
className,
|
||||
dates,
|
||||
minDate,
|
||||
maxDate,
|
||||
onDatesChange,
|
||||
disabled,
|
||||
}: React.HTMLAttributes<HTMLDivElement> & DatePickerWithRangeProps) {
|
||||
@@ -56,6 +60,8 @@ export function DatePickerWithRange({
|
||||
<PopoverContent className="w-auto p-0" align="start">
|
||||
<Calendar
|
||||
initialFocus
|
||||
fromDate={minDate}
|
||||
toDate={maxDate}
|
||||
mode="range"
|
||||
defaultMonth={dates?.startDate}
|
||||
selected={{ from: dates?.startDate, to: dates?.endDate }}
|
||||
|
||||
Reference in new issue
Block a user