From 2e719cfb80e4d3d9b82008ac4d89da2a5cd878ea Mon Sep 17 00:00:00 2001 From: Denise Li Date: Tue, 17 Sep 2024 20:03:23 -0400 Subject: [PATCH] chore: remove Page.Header console component (#2712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 1 of https://github.com/TBD54566975/ftl/issues/2490 Deletes the `Page.Header` component, which is an artifact of a bygone era. Since the timeline page also had a time range filter embedded in the header, I moved that over to the left-hand-side filter panel. It just need a tiny bit of resizing to fit. Screenshot 2024-09-17 at 4 29 45 PM Screenshot 2024-09-17 at 4 36 51 PM --------- Co-authored-by: github-actions[bot] --- .../src/features/console/ConsolePage.tsx | 2 - .../src/features/timeline/TimelinePage.tsx | 5 +- .../timeline/filters/TimelineTimeControls.tsx | 26 +++++----- frontend/console/src/layout/Page.tsx | 48 ------------------- 4 files changed, 15 insertions(+), 66 deletions(-) diff --git a/frontend/console/src/features/console/ConsolePage.tsx b/frontend/console/src/features/console/ConsolePage.tsx index b547c8746d..71ec658c3b 100644 --- a/frontend/console/src/features/console/ConsolePage.tsx +++ b/frontend/console/src/features/console/ConsolePage.tsx @@ -1,4 +1,3 @@ -import { CubeIcon } from 'hugeicons-react' import { useState } from 'react' import { type NavigateFunction, useNavigate } from 'react-router-dom' import { useModules } from '../../api/modules/use-modules' @@ -25,7 +24,6 @@ export const ConsolePage = () => { return ( - } title='Console' /> } diff --git a/frontend/console/src/features/timeline/TimelinePage.tsx b/frontend/console/src/features/timeline/TimelinePage.tsx index 5aadeaa494..1655e24f33 100644 --- a/frontend/console/src/features/timeline/TimelinePage.tsx +++ b/frontend/console/src/features/timeline/TimelinePage.tsx @@ -1,4 +1,3 @@ -import { ListViewIcon } from 'hugeicons-react' import { useEffect, useState } from 'react' import { useSearchParams } from 'react-router-dom' import { Page } from '../../layout' @@ -35,11 +34,9 @@ export const TimelinePage = () => { return ( - } title='Events'> - -
+
diff --git a/frontend/console/src/features/timeline/filters/TimelineTimeControls.tsx b/frontend/console/src/features/timeline/filters/TimelineTimeControls.tsx index 07bfbf7d57..82a3562b0e 100644 --- a/frontend/console/src/features/timeline/filters/TimelineTimeControls.tsx +++ b/frontend/console/src/features/timeline/filters/TimelineTimeControls.tsx @@ -101,20 +101,22 @@ export const TimelineTimeControls = ({ const olderThan = newerThan ? Timestamp.fromDate(new Date(newerThan.toDate().getTime() - selected.value)) : undefined return ( <> -
- {newerThan && ( - - {formatTimestampTime(olderThan)} - {formatTimestampTime(newerThan)} - - )} - + {newerThan && ( +
+ {formatTimestampTime(olderThan)} - {formatTimestampTime(newerThan)} +
+ )} +
-
+
{selected.label} - + @@ -165,14 +167,14 @@ export const TimelineTimeControls = ({ diff --git a/frontend/console/src/layout/Page.tsx b/frontend/console/src/layout/Page.tsx index 7e07c9fb98..78e30c2290 100644 --- a/frontend/console/src/layout/Page.tsx +++ b/frontend/console/src/layout/Page.tsx @@ -1,52 +1,6 @@ -import { ArrowRight02Icon } from 'hugeicons-react' import type React from 'react' import { classNames } from '../utils' -interface Breadcrumb { - label: string - link?: string -} - -const Header = ({ - icon, - title, - children, - breadcrumbs, - className, -}: { - icon?: React.ReactNode - title: string - children?: React.ReactNode - breadcrumbs?: Breadcrumb[] - className?: string -}) => { - return ( -
-
- {icon} - {breadcrumbs && breadcrumbs.length > 0 && ( - - )} - {title} -
- {children} -
- ) -} - const Body: React.FC<{ className?: string style?: React.CSSProperties @@ -64,7 +18,6 @@ export const Page: React.FC<{ style?: React.CSSProperties children?: React.ReactNode }> & { - Header: typeof Header Body: typeof Body } = ({ className, style, children }) => { return ( @@ -74,5 +27,4 @@ export const Page: React.FC<{ ) } -Page.Header = Header Page.Body = Body