From 7800fce2ecd31ed18222121c0050945e39cbc508 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 27 Aug 2025 16:28:15 -0700 Subject: [PATCH 1/3] set maxheight to modals --- .../(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx | 5 ++++- .../(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx | 5 ++++- .../websites/[websiteId]/segments/SegmentAddButton.tsx | 5 ++++- .../websites/[websiteId]/segments/SegmentEditButton.tsx | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx b/src/app/(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx index 3f155f64..aa62f1d9 100644 --- a/src/app/(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx +++ b/src/app/(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx @@ -15,7 +15,10 @@ export function CohortAddButton({ websiteId }: { websiteId: string }) { {formatMessage(labels.cohort)} - + {({ close }) => { return ; }} diff --git a/src/app/(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx b/src/app/(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx index 411f932a..9abb986d 100644 --- a/src/app/(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx +++ b/src/app/(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx @@ -17,7 +17,10 @@ export function CohortEditButton({ return ( }> - + {({ close }) => { return ( {formatMessage(labels.segment)} - + {({ close }) => { return ; }} diff --git a/src/app/(main)/websites/[websiteId]/segments/SegmentEditButton.tsx b/src/app/(main)/websites/[websiteId]/segments/SegmentEditButton.tsx index ba8f82b4..951eaeb9 100644 --- a/src/app/(main)/websites/[websiteId]/segments/SegmentEditButton.tsx +++ b/src/app/(main)/websites/[websiteId]/segments/SegmentEditButton.tsx @@ -17,7 +17,10 @@ export function SegmentEditButton({ return ( }> - + {({ close }) => { return ( Date: Wed, 27 Aug 2025 16:59:44 -0700 Subject: [PATCH 2/3] Updated WebsiteSelect behavior. Fixed date select. --- src/components/hooks/useDateRange.ts | 7 +------ src/components/input/WebsiteSelect.tsx | 17 ++++++++++++++++- src/lib/prisma.ts | 4 ++-- src/lib/types.ts | 7 ++++--- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/components/hooks/useDateRange.ts b/src/components/hooks/useDateRange.ts index 4de13ae8..0a82d5a3 100644 --- a/src/components/hooks/useDateRange.ts +++ b/src/components/hooks/useDateRange.ts @@ -10,7 +10,6 @@ import { useNavigation } from './useNavigation'; export interface UseDateRangeOptions { ignoreOffset?: boolean; - useQueryParameter?: boolean; } export function useDateRange(websiteId?: string, options: UseDateRangeOptions = {}) { @@ -21,11 +20,7 @@ export function useDateRange(websiteId?: string, options: UseDateRangeOptions = } = useNavigation(); const websiteConfig = useWebsites(state => state[websiteId]?.dateRange); const globalConfig = useApp(state => state.dateRangeValue); - const dateValue = - (options.useQueryParameter ? date : false) || - websiteConfig?.value || - globalConfig || - DEFAULT_DATE_RANGE_VALUE; + const dateValue = websiteConfig?.value || date || globalConfig || DEFAULT_DATE_RANGE_VALUE; const dateRange = useMemo(() => { const dateRangeObject = parseDateRange(dateValue, locale); diff --git a/src/components/input/WebsiteSelect.tsx b/src/components/input/WebsiteSelect.tsx index 917c7d21..0df4c1af 100644 --- a/src/components/input/WebsiteSelect.tsx +++ b/src/components/input/WebsiteSelect.tsx @@ -1,6 +1,12 @@ import { useState } from 'react'; import { Select, SelectProps, ListItem, Text } from '@umami/react-zen'; -import { useUserWebsitesQuery, useWebsiteQuery, useNavigation } from '@/components/hooks'; +import { + useUserWebsitesQuery, + useWebsiteQuery, + useNavigation, + useMessages, +} from '@/components/hooks'; +import { Empty } from '@/components/common/Empty'; export function WebsiteSelect({ websiteId, @@ -10,6 +16,7 @@ export function WebsiteSelect({ websiteId?: string; teamId?: string; } & SelectProps) { + const { formatMessage, messages } = useMessages(); const { router, renderUrl } = useNavigation(); const [search, setSearch] = useState(''); const { data: website } = useWebsiteQuery(websiteId); @@ -23,6 +30,10 @@ export function WebsiteSelect({ setSearch(value); }; + const handleOpenChange = () => { + setSearch(''); + }; + return (