From 8897c2508d6925f1ec58f7d155f1daf8e2af7b39 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 8 Aug 2025 17:39:17 -0700 Subject: [PATCH] Fixed scrolling on expanded view. --- .../[websiteId]/WebsiteDetailsPage.tsx | 2 +- .../[websiteId]/WebsiteExpandedView.tsx | 4 +- src/components/common/LoadingPanel.tsx | 2 +- src/components/metrics/MetricsTable.tsx | 49 ++++++++++--------- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/WebsiteDetailsPage.tsx b/src/app/(main)/websites/[websiteId]/WebsiteDetailsPage.tsx index 99517bb5..33bca5ae 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteDetailsPage.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteDetailsPage.tsx @@ -34,7 +34,7 @@ export function WebsiteDetailsPage({ websiteId }: { websiteId: string }) { - + {({ close }) => { return handleClose(close)} />; }} diff --git a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx index dabb2f49..ad2f8653 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx @@ -133,7 +133,7 @@ export function WebsiteExpandedView({ const DetailsComponent = views[view] || (() => null); return ( - + {items.map(({ id, label, path }) => { @@ -145,7 +145,7 @@ export function WebsiteExpandedView({ })} - + + {/* Show loading spinner only if no data exists */} {(isLoading || isFetching) && !data && } diff --git a/src/components/metrics/MetricsTable.tsx b/src/components/metrics/MetricsTable.tsx index 8bac8f93..2f88b415 100644 --- a/src/components/metrics/MetricsTable.tsx +++ b/src/components/metrics/MetricsTable.tsx @@ -1,3 +1,5 @@ +import { ReactNode, useMemo, useState } from 'react'; +import { Button, Column, Icon, Row, SearchField, Text, Grid } from '@umami/react-zen'; import { LinkButton } from '@/components/common/LinkButton'; import { LoadingPanel } from '@/components/common/LoadingPanel'; import { @@ -11,8 +13,7 @@ import { Close, Maximize } from '@/components/icons'; import { DownloadButton } from '@/components/input/DownloadButton'; import { DEFAULT_ANIMATION_DURATION } from '@/lib/constants'; import { percentFilter } from '@/lib/filters'; -import { Button, Column, Icon, Row, SearchField, Text } from '@umami/react-zen'; -import { ReactNode, useMemo, useState } from 'react'; + import { ListExpandedTable, ListExpandedTableProps } from './ListExpandedTable'; import { ListTable, ListTableProps } from './ListTable'; @@ -115,11 +116,11 @@ export function MetricsTable({ const downloadData = isExpanded ? data : filteredData; return ( - - - + + + {allowSearch && } - + {children} {allowDownload && } {onClose && ( @@ -131,23 +132,25 @@ export function MetricsTable({ )} - {data && - (isExpanded ? ( - - ) : ( - - ))} - - {showMore && data && !error && limit && ( - - - - - {formatMessage(labels.more)} - + + {data && + (isExpanded ? ( + + ) : ( + + ))} + {showMore && limit && ( + + + + + + {formatMessage(labels.more)} + + )} - - - + + + ); }