1
- import { Box , SvgIconProps , Theme , useMediaQuery } from '@mui/material' ;
1
+ import { Box , SvgIconProps } from '@mui/material' ;
2
2
import { CaptionSmall } from '../typography' ;
3
3
import { PropsWithChildren , ReactElement , ReactNode } from 'react' ;
4
4
import { Actions } from '../actions/Actions' ;
@@ -25,50 +25,36 @@ const PageContentBlockHeader = ({
25
25
fullWidth,
26
26
children,
27
27
} : PropsWithChildren < PageContentBlockHeaderProps > ) => {
28
- const isSmallScreen = useMediaQuery ( ( theme : Theme ) => theme . breakpoints . down ( 'lg' ) ) ;
29
- const isMobile = useMediaQuery ( ( theme : Theme ) => theme . breakpoints . down ( 'sm' ) ) ;
30
-
31
28
const nextBlock = useNextBlockAnchor ( ) ;
32
29
33
30
return (
34
- < >
31
+ < Box
32
+ display = "flex"
33
+ flexDirection = "row"
34
+ alignItems = "center"
35
+ gap = { gutters ( 0.5 ) }
36
+ position = "relative"
37
+ width = { fullWidth ? '100%' : undefined }
38
+ >
39
+ < SkipLink anchor = { nextBlock } sx = { { position : 'absolute' , right : 0 , top : 0 } } />
35
40
< Box
41
+ flexGrow = { 1 }
42
+ minWidth = { 0 }
36
43
display = "flex"
37
44
flexDirection = "row"
38
- alignItems = { isSmallScreen ? 'start' : 'center' }
39
- gap = { gutters ( 0.5 ) }
40
- position = "relative"
41
- width = { fullWidth ? '100%' : undefined }
45
+ rowGap = { gutters ( 0.5 ) }
46
+ justifyContent = "space-between"
47
+ flexWrap = "wrap"
42
48
>
43
- < SkipLink anchor = { nextBlock } sx = { { position : 'absolute' , right : 0 , top : 0 } } />
44
- < Box
45
- flexGrow = { 1 }
46
- minWidth = { 0 }
47
- display = "flex"
48
- flexDirection = "row"
49
- rowGap = { gutters ( 0.5 ) }
50
- justifyContent = "space-between"
51
- flexWrap = "wrap"
52
- >
53
- < BlockTitleWithIcon title = { title } icon = { icon } />
54
- { disclaimer && < CaptionSmall > { disclaimer } </ CaptionSmall > }
55
- { children }
56
- </ Box >
57
- { ! isMobile && (
58
- // In desktop the expand button and the actions go in the same row
59
- < Actions >
60
- { actions }
61
- { dialogAction }
62
- </ Actions >
63
- ) }
64
- { isMobile && < Actions > { dialogAction } </ Actions > }
49
+ < BlockTitleWithIcon title = { title } icon = { icon } />
50
+ { disclaimer && < CaptionSmall > { disclaimer } </ CaptionSmall > }
51
+ { children }
65
52
</ Box >
66
- { isMobile && (
67
- < Actions marginTop = { gutters ( - 0.5 ) } flexDirection = "row" >
68
- { actions }
69
- </ Actions >
70
- ) }
71
- </ >
53
+ < Actions height = { gutters ( ) } >
54
+ { actions }
55
+ { dialogAction }
56
+ </ Actions >
57
+ </ Box >
72
58
) ;
73
59
} ;
74
60
0 commit comments