@@ -5,11 +5,12 @@ import { classes, prefixClasses, compile } from 'core/js/reactHelpers';
5
5
6
6
/**
7
7
* Content header for displayTitle, body, instruction text, etc.
8
- * instruction and mobileInstruction will switch automatically
8
+ * body / mobileBody and instruction / mobileInstruction will switch automatically
9
9
* @param {Object } props
10
10
* @param {string } [props.displayTitle]
11
11
* @param {string } [props.body]
12
12
* @param {string } [props.instruction]
13
+ * @param {string } [props.mobileBody]
13
14
* @param {string } [props.mobileInstruction]
14
15
* @param {string } [props._type]
15
16
* @param {string } [props._component]
@@ -22,6 +23,7 @@ export default function Header(props) {
22
23
displayTitle,
23
24
body,
24
25
instruction,
26
+ mobileBody,
25
27
mobileInstruction,
26
28
_type,
27
29
_component,
@@ -33,6 +35,9 @@ export default function Header(props) {
33
35
_extension && _extension . toLowerCase ( )
34
36
] . filter ( Boolean )
35
37
} = props ;
38
+ const sizedBody = ( mobileBody && ! device . isScreenSizeMin ( 'medium' ) ) ?
39
+ mobileBody :
40
+ body ;
36
41
const sizedInstruction = ( mobileInstruction && ! device . isScreenSizeMin ( 'medium' ) ) ?
37
42
mobileInstruction :
38
43
instruction ;
@@ -69,9 +74,9 @@ export default function Header(props) {
69
74
</ div >
70
75
}
71
76
72
- { body &&
77
+ { sizedBody &&
73
78
< div className = { prefixClasses ( classNamePrefixes , [ '__body' ] ) } >
74
- < div className = { prefixClasses ( classNamePrefixes , [ '__body-inner' ] ) } dangerouslySetInnerHTML = { { __html : compile ( body , props ) } } >
79
+ < div className = { prefixClasses ( classNamePrefixes , [ '__body-inner' ] ) } dangerouslySetInnerHTML = { { __html : compile ( sizedBody , props ) } } >
75
80
</ div >
76
81
</ div >
77
82
}
0 commit comments