From 70a7d994635b7ae00dab73f206ec124acd0f5cf0 Mon Sep 17 00:00:00 2001 From: gitstart Date: Tue, 2 May 2023 12:04:53 +0000 Subject: [PATCH] chore: Enhance the title tag on dashboard pages Co-authored-by: BikashSah999 <51731962+BikashSah999@users.noreply.github.com> --- .../layouts/ProjectLayout/ProjectLayout.tsx | 12 ++++++++++-- .../layouts/TableEditorLayout/TableEditorLayout.tsx | 3 +++ studio/pages/project/[ref]/editor/[id].tsx | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/studio/components/layouts/ProjectLayout/ProjectLayout.tsx index 11c972561ba..908401c3eb2 100644 --- a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx +++ b/studio/components/layouts/ProjectLayout/ProjectLayout.tsx @@ -26,6 +26,7 @@ export interface ProjectLayoutProps { hideHeader?: boolean hideIconBar?: boolean children: ReactNode + selectedTable?: string } const ProjectLayout = ({ @@ -36,12 +37,13 @@ const ProjectLayout = ({ children, hideHeader = false, hideIconBar = false, + selectedTable, }: ProjectLayoutProps) => { const { ui } = useStore() const router = useRouter() const { ref: projectRef } = useParams() const ongoingIncident = useFlag('ongoingIncident') - const projectName = ui.selectedProject?.name + const organizationName = ui.selectedOrganization?.name const isPaused = ui.selectedProject?.status === PROJECT_STATUS.INACTIVE const ignorePausedState = @@ -52,7 +54,13 @@ const ProjectLayout = ({ - {title ? `${title} | Supabase` : projectName ? `${projectName} | Supabase` : 'Supabase'} + {title + ? `${title} | Supabase` + : selectedTable + ? `${selectedTable} | ${organizationName} | Supabase` + : organizationName + ? `${organizationName} | Supabase` + : 'Supabase'} diff --git a/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx b/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx index af9d3c9d067..60143db8f77 100644 --- a/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx +++ b/studio/components/layouts/TableEditorLayout/TableEditorLayout.tsx @@ -19,6 +19,7 @@ import useTableRowsPrefetchWrapper from './TableEditorLayout.utils' export interface TableEditorLayoutProps { selectedSchema?: string + selectedTable?: string onSelectSchema: (schema: string) => void onAddTable: () => void onEditTable: (table: Entity) => void @@ -28,6 +29,7 @@ export interface TableEditorLayoutProps { const TableEditorLayout = ({ selectedSchema, + selectedTable, onSelectSchema = noop, onAddTable = noop, onEditTable = noop, @@ -123,6 +125,7 @@ const TableEditorLayout = ({ return ( { return (