@@ -3,20 +3,36 @@ import { FormDetailsProps } from 'types/component-props/parts/form-details';
3
3
import { EditorHelp } from 'components/_editor-only/editor-help/EditorHelp' ;
4
4
import { FormDetails } from 'components/_common/form-details/FormDetails' ;
5
5
import { FilteredContent } from '../../_common/filtered-content/FilteredContent' ;
6
+ import {
7
+ ContentType ,
8
+ } from 'types/content-props/_content-common' ;
6
9
7
- export const FormDetailsPart = ( { config } : FormDetailsProps ) => {
10
+ export const FormDetailsPart = ( { config, pageProps } : FormDetailsProps ) => {
8
11
const { targetFormDetails, ...displayConfig } = config ;
9
12
13
+ // This is a temporary solution to show the title as level 4 on product pages
14
+ // that have been re-organized as part of the Maler 2.0.
15
+ // When all product pages have been re-organized, we can remove the reference and
16
+ // config for showTitleAsLevel4.
17
+ const showTitleAsLevel4 =
18
+ pageProps . type === ContentType . ProductPage &&
19
+ pageProps . data ?. showSubsectionNavigation ;
20
+
10
21
if ( ! targetFormDetails ) {
11
22
return < EditorHelp text = { 'Velg hvilken skjemadetalj som skal vises' } /> ;
12
23
}
13
24
const formDetails = targetFormDetails . data ;
14
25
26
+ const modifiedDisplayConfig = {
27
+ ...displayConfig ,
28
+ showTitleAsLevel4,
29
+ } ;
30
+
15
31
return (
16
32
< FilteredContent { ...config } >
17
33
< FormDetails
18
34
formDetails = { formDetails }
19
- displayConfig = { displayConfig }
35
+ displayConfig = { modifiedDisplayConfig }
20
36
/>
21
37
</ FilteredContent >
22
38
) ;
0 commit comments