diff --git a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx index 3b73339550..dc60d88274 100644 --- a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx +++ b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx @@ -3,27 +3,29 @@ import { Link, useLocation } from 'react-router-dom'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import AccessContext from 'contexts/AccessContext'; import { useContext } from 'react'; -import StringTruncator from '../StringTruncator/StringTruncator'; import { styled } from '@mui/material'; +import { textTruncated } from 'themes/themeStyles'; const StyledBreadcrumbContainer = styled('div')(({ theme }) => ({ height: theme.spacing(2.5), margin: theme.spacing(2, 0), })); -const StyledParagraph = styled('p')({ - color: 'inherit', - '& > *': { - verticalAlign: 'middle', +const StyledBreadcrumbs = styled(Breadcrumbs)({ + '& > ol': { + flexWrap: 'nowrap', + '& > li:last-child': { + minWidth: 0, + }, }, }); +const StyledParagraph = styled('p')(textTruncated); + const StyledLink = styled(Link)(({ theme }) => ({ - textDecoration: 'none', '& > *': { - verticalAlign: 'middle', + maxWidth: theme.spacing(25), }, - color: theme.palette.primary.main, })); const BreadcrumbNav = () => { @@ -60,17 +62,13 @@ const BreadcrumbNav = () => { 1} show={ - + {paths.map((path, index) => { const lastItem = index === paths.length - 1; if (lastItem) { return ( - + {path} ); } @@ -87,15 +85,13 @@ const BreadcrumbNav = () => { return ( - + + {path} + ); })} - + } /> } diff --git a/frontend/src/themes/theme.ts b/frontend/src/themes/theme.ts index a885e11c26..e929184c6d 100644 --- a/frontend/src/themes/theme.ts +++ b/frontend/src/themes/theme.ts @@ -190,9 +190,9 @@ export default createTheme({ fontSize: '0.875rem', '& a': { color: colors.purple[900], - textDecoration: 'underline', + textDecoration: 'none', '&:hover': { - textDecoration: 'none', + textDecoration: 'underline', }, }, }, diff --git a/frontend/src/themes/themeStyles.ts b/frontend/src/themes/themeStyles.ts index 55fb615692..923de4e369 100644 --- a/frontend/src/themes/themeStyles.ts +++ b/frontend/src/themes/themeStyles.ts @@ -29,6 +29,12 @@ export const textCenter = { textAlign: 'center', } as const; +export const textTruncated = { + textOverflow: 'ellipsis', + overflow: 'hidden', + whiteSpace: 'nowrap', +} as const; + export const flexRow = { display: 'flex', alignItems: 'center',