33 * See the LICENSE file in the repository root folder for details.
44 */
55
6- import { Typography , Box , Grid } from '@mui/material' ;
6+ import { Typography , Box , Grid , useTheme } from '@mui/material' ;
77import { ReactElement , ReactNode } from 'react' ;
88import { LinkItem } from '../../utils/types' ;
99import PageBreadcrumbs from './PageBreadcrumbs' ;
@@ -13,6 +13,7 @@ interface PageTitleProps {
1313 previousPages : LinkItem [ ] ;
1414 headerRight ?: ReactNode ;
1515 tabs ?: ReactElement ;
16+ sticky ?: boolean ;
1617}
1718
1819/**
@@ -22,11 +23,22 @@ interface PageTitleProps {
2223 * @param headerRight The button to display on the right side of the page title
2324 * @param tabs The tabs on the page to display.
2425 */
25- const PageTitle : React . FC < PageTitleProps > = ( { title, previousPages, headerRight, tabs } ) => {
26+ const PageTitle : React . FC < PageTitleProps > = ( { title, previousPages, headerRight, tabs, sticky } ) => {
27+ const theme = useTheme ( ) ;
28+
2629 return (
2730 < >
28- < PageBreadcrumbs currentPageTitle = { title } previousPages = { previousPages } />
29- < Box sx = { { mb : 2 } } >
31+ < Box mb = { sticky ? - 1 : 0 } >
32+ < PageBreadcrumbs currentPageTitle = { title } previousPages = { previousPages } />
33+ </ Box >
34+ < Box
35+ mb = { 2 }
36+ position = { sticky ? 'sticky' : 'initial' }
37+ top = { 65 }
38+ pt = { sticky ? 1 : 0 }
39+ zIndex = { 1 }
40+ bgcolor = { theme . palette . background . default }
41+ >
3042 < Grid container >
3143 < Grid item xs = { 6 } md = { 8 } >
3244 < Typography variant = "h4" fontSize = { 30 } >
0 commit comments