From 2be97db3351edb00e71348e500bb55a0f4e2a18c Mon Sep 17 00:00:00 2001 From: SanjeevLakhwani Date: Thu, 19 Dec 2024 08:04:56 -0500 Subject: [PATCH] Modified catalogue logo and title --- src/js/components/SiteSider.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/js/components/SiteSider.tsx b/src/js/components/SiteSider.tsx index a066a913..fc5dd4fa 100644 --- a/src/js/components/SiteSider.tsx +++ b/src/js/components/SiteSider.tsx @@ -4,7 +4,13 @@ import { useLocation, useNavigate } from 'react-router-dom'; import type { MenuProps, SiderProps } from 'antd'; import { Layout, Menu } from 'antd'; -import Icon, { PieChartOutlined, SearchOutlined, ShareAltOutlined, SolutionOutlined } from '@ant-design/icons'; +import Icon, { + BookOutlined, + PieChartOutlined, + SearchOutlined, + ShareAltOutlined, + SolutionOutlined, +} from '@ant-design/icons'; import BeaconSvg from '@/components/Beacon/BeaconSvg'; import { useSearchQuery } from '@/features/search/hooks'; @@ -12,6 +18,7 @@ import { useTranslationFn } from '@/hooks'; import { BentoRoute } from '@/types/routes'; import { buildQueryParamsUrl } from '@/utils/search'; import { getCurrentPage } from '@/utils/router'; +import { useMetadata, useSelectedProject } from '@/features/metadata/hooks'; const { Sider } = Layout; @@ -30,6 +37,10 @@ const SiteSider: React.FC<{ const t = useTranslationFn(); const { queryParams } = useSearchQuery(); const currentPage = getCurrentPage(); + const selectedProject = useSelectedProject(); + const { projects } = useMetadata(); + + const isCataloguePage = useMemo(() => !selectedProject && projects.length > 1, [projects, selectedProject]); const handleMenuClick: OnClick = useCallback( ({ key }: { key: string }) => { @@ -60,7 +71,11 @@ const SiteSider: React.FC<{ const menuItems: MenuItem[] = useMemo(() => { const items = [ - createMenuItem('Overview', BentoRoute.Overview, ), + createMenuItem( + isCataloguePage ? 'Catalogue' : 'Overview', + BentoRoute.Overview, + isCataloguePage ? : + ), createMenuItem('Search', BentoRoute.Search, ), createMenuItem('Provenance', BentoRoute.Provenance, ), ];