From 3ac6fc542751f85a7923ba9696c5b46c85091db1 Mon Sep 17 00:00:00 2001 From: David Leek Date: Mon, 17 Jun 2024 13:45:36 +0200 Subject: [PATCH] chore: adds icons for insights and playground paths to recently visited --- .../commandBar/RecentlyVisited/RecentlyVisited.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/commandBar/RecentlyVisited/RecentlyVisited.tsx b/frontend/src/component/commandBar/RecentlyVisited/RecentlyVisited.tsx index 70918fa5a3..cf41ed4962 100644 --- a/frontend/src/component/commandBar/RecentlyVisited/RecentlyVisited.tsx +++ b/frontend/src/component/commandBar/RecentlyVisited/RecentlyVisited.tsx @@ -12,10 +12,13 @@ import { IconRenderer, StyledProjectIcon, } from 'component/layout/MainLayout/NavigationSidebar/IconRenderer'; +import PlaygroundIcon from '@mui/icons-material/AutoFixNormal'; +import InsightsIcon from '@mui/icons-material/Insights'; import type { LastViewedPage } from 'hooks/useRecentlyVisited'; import type { Theme } from '@mui/material/styles/createTheme'; import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import type { ReactElement } from 'react-markdown/lib/react-markdown'; const listItemButtonStyle = (theme: Theme) => ({ borderRadius: theme.spacing(0.5), @@ -39,6 +42,12 @@ const StyledListItemText = styled(ListItemText)(({ theme }) => ({ margin: 0, })); +const overridePathIcons: Record ReactElement> = { + '/insights': () => , + '/playground': () => , + '/projects': () => , +}; + const toListItemButton = ( item: LastViewedPage, routes: Record, @@ -107,8 +116,8 @@ const RecentlyVisitedPathButton = ({ > } + condition={overridePathIcons[path] !== undefined} + show={overridePathIcons[path]} elseShow={} />