@@ -9,7 +9,9 @@ import { TextComponentType } from '../../text/types/component';
9
9
import {
10
10
DraggableIcon ,
11
11
ModalCloseButtonStyled ,
12
+ ModalHeaderContentStyled ,
12
13
ModalHeaderStyled ,
14
+ TitleContainerStyled ,
13
15
TitleHiddenContainer ,
14
16
} from '../modal.styled' ;
15
17
import { IModalStandAlone } from '../types/modal' ;
@@ -27,41 +29,47 @@ type ModalHeaderProps = Pick<IModalStandAlone, PickedProps> & {
27
29
} ;
28
30
29
31
export const ModalHeader = ( props : ModalHeaderProps ) : JSX . Element => {
30
- const isMobile = props . device === DeviceBreakpointsType . MOBILE ;
32
+ const isMobileOrTablet =
33
+ props . device === DeviceBreakpointsType . MOBILE || props . device === DeviceBreakpointsType . TABLET ;
31
34
32
35
return (
33
36
< ModalHeaderStyled data-modal-header $styles = { props . styles } >
34
- { isMobile && ! props . blocked && props . dragIcon && (
37
+ { isMobileOrTablet && ! props . blocked && props . dragIcon && (
35
38
< DraggableIcon data-modal-draggable-icon $styles = { props . styles } >
36
39
< ElementOrIcon customIconStyles = { props . styles ?. dragIcon } { ...props . dragIcon } />
37
40
</ DraggableIcon >
38
41
) }
39
- { ! props . blocked && props . closeIcon ?. icon && (
40
- < ModalCloseButtonStyled $styles = { props . styles } >
41
- < ElementOrIcon customIconStyles = { props . styles ?. closeButtonIcon } { ...props . closeIcon } />
42
- </ ModalCloseButtonStyled >
43
- ) }
44
- { ! props . blocked &&
45
- props . closeButton ?. content &&
46
- ( props . styles . closeButton ?. buttonVariant || props . closeButton ?. variant ) && (
47
- < Button variant = { props . styles . closeButton ?. buttonVariant } { ...props . closeButton } >
48
- { props . closeButton . content }
49
- </ Button >
42
+
43
+ < ModalHeaderContentStyled $styles = { props . styles } >
44
+ { ! props . blocked && props . closeIcon ?. icon && (
45
+ < ModalCloseButtonStyled $styles = { props . styles } >
46
+ < ElementOrIcon customIconStyles = { props . styles ?. closeButtonIcon } { ...props . closeIcon } />
47
+ </ ModalCloseButtonStyled >
50
48
) }
51
- { props . title ?. visible === undefined || props . title . visible ? (
52
- < >
53
- < Text
54
- component = { TextComponentType . H1 }
55
- customTypography = { props . styles . title }
56
- id = { props . titleIdFinal }
57
- { ...props . title }
58
- >
49
+ { ! props . blocked &&
50
+ props . closeButton ?. content &&
51
+ ( props . styles . closeButton ?. buttonVariant || props . closeButton ?. variant ) && (
52
+ < Button variant = { props . styles . closeButton ?. buttonVariant } { ...props . closeButton } >
53
+ { props . closeButton . content }
54
+ </ Button >
55
+ ) }
56
+ { props . title ?. visible === undefined || props . title . visible ? (
57
+ < TitleContainerStyled $styles = { props . styles } >
58
+ < Text
59
+ component = { TextComponentType . H1 }
60
+ customTypography = { props . styles . title }
61
+ id = { props . titleIdFinal }
62
+ { ...props . title }
63
+ >
64
+ { props . title ?. content }
65
+ </ Text >
66
+ </ TitleContainerStyled >
67
+ ) : (
68
+ < TitleHiddenContainer id = { props . titleIdFinal } >
59
69
{ props . title ?. content }
60
- </ Text >
61
- </ >
62
- ) : (
63
- < TitleHiddenContainer id = { props . titleIdFinal } > { props . title ?. content } </ TitleHiddenContainer >
64
- ) }
70
+ </ TitleHiddenContainer >
71
+ ) }
72
+ </ ModalHeaderContentStyled >
65
73
</ ModalHeaderStyled >
66
74
) ;
67
75
} ;
0 commit comments