From 254e582ebb5ac4c64d918e44bfa2daa114dbb77c Mon Sep 17 00:00:00 2001 From: Akshay Shekhawat Date: Sat, 13 Aug 2022 18:13:51 -0700 Subject: [PATCH] add titles --- frontend/src/components/SidebarLayoutShell.tsx | 9 ++++++++- frontend/src/pages/alerts.tsx | 5 ++++- frontend/src/pages/connections.tsx | 2 +- frontend/src/pages/endpoint/[endpointUUID].tsx | 5 ++++- frontend/src/pages/endpoints.tsx | 2 +- frontend/src/pages/index.tsx | 2 +- frontend/src/pages/specs.tsx | 2 +- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/SidebarLayoutShell.tsx b/frontend/src/components/SidebarLayoutShell.tsx index f9e29dc0..3b96dab7 100644 --- a/frontend/src/components/SidebarLayoutShell.tsx +++ b/frontend/src/components/SidebarLayoutShell.tsx @@ -1,18 +1,25 @@ import React from "react"; +import Head from "next/head"; import { Box, HStack } from "@chakra-ui/react"; import SideNavBar from "./Sidebar"; import { SideNavLinkDestination } from "components/Sidebar/NavLinkUtils"; import { DarkModeSwitch } from "components/utils/DarkModeSwitch"; interface SidebarLayoutShellProps { + title?: string; currentTab?: SideNavLinkDestination; children?: React.ReactNode; } export const SidebarLayoutShell: React.FC = React.memo( - ({ currentTab, children }) => { + ({ title, currentTab, children }) => { return ( + {title ? ( + + {title} + + ) : null} {children} diff --git a/frontend/src/pages/alerts.tsx b/frontend/src/pages/alerts.tsx index 78bb9b30..dcda3b94 100644 --- a/frontend/src/pages/alerts.tsx +++ b/frontend/src/pages/alerts.tsx @@ -30,7 +30,10 @@ const Alerts = () => { fetchAlerts(); }, [params]); return ( - + diff --git a/frontend/src/pages/connections.tsx b/frontend/src/pages/connections.tsx index a2243cbd..dc78b4e6 100644 --- a/frontend/src/pages/connections.tsx +++ b/frontend/src/pages/connections.tsx @@ -9,7 +9,7 @@ import { testConnections } from "testData"; import { Connection } from "@common/types"; const Connections = ({ connections }) => ( - + diff --git a/frontend/src/pages/endpoint/[endpointUUID].tsx b/frontend/src/pages/endpoint/[endpointUUID].tsx index dd4f5957..a61d64a1 100644 --- a/frontend/src/pages/endpoint/[endpointUUID].tsx +++ b/frontend/src/pages/endpoint/[endpointUUID].tsx @@ -16,7 +16,10 @@ const Endpoint = ({ endpoint, usage }) => { return ; } return ( - + ); diff --git a/frontend/src/pages/endpoints.tsx b/frontend/src/pages/endpoints.tsx index 4c2b3420..7cd38734 100644 --- a/frontend/src/pages/endpoints.tsx +++ b/frontend/src/pages/endpoints.tsx @@ -36,7 +36,7 @@ const Endpoints = () => { fetchEndpoints(); }, [params]); return ( - + diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 3decc426..c9632c2b 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -12,7 +12,7 @@ const Index = ({ summary, topAlerts }) => { const parsedSummary = superjson.parse(summary); const parsedTopAlerts = superjson.parse(topAlerts); return ( - + diff --git a/frontend/src/pages/specs.tsx b/frontend/src/pages/specs.tsx index 7f89cbe6..dd8dec20 100644 --- a/frontend/src/pages/specs.tsx +++ b/frontend/src/pages/specs.tsx @@ -9,7 +9,7 @@ import { OpenApiSpec } from "@common/types"; import { getSpecs } from "api/apiSpecs"; const Specs = ({ apiSpecs }) => ( - +