@@ -3,8 +3,7 @@ import React from 'react';
33import { Meta , Story } from '@storybook/react/types-6-0' ;
44
55import { CONTAINERS } from '../../../demo/constants' ;
6- import { HeaderBlockModel , NavigationData } from '../../../models' ;
7- import { PageConstructor } from '../PageConstructor' ;
6+ import { PageConstructor , PageConstructorProps } from '../PageConstructor' ;
87
98import data from './data.json' ;
109
@@ -13,51 +12,37 @@ export default {
1312 component : PageConstructor ,
1413} as Meta ;
1514
16- interface TemplateProps {
17- items : HeaderBlockModel [ ] ;
18- navigation ?: NavigationData ;
19- }
20-
21- const DefaultTemplate : Story < TemplateProps > = ( args ) => (
22- < PageConstructor
23- content = { {
24- blocks : args . items ,
25- background : data . default . background ,
26- } }
27- />
28- ) ;
15+ const DefaultTemplate : Story < PageConstructorProps > = ( args ) => < PageConstructor { ...args } /> ;
2916
30- const WithFootnotesTemplate : Story < TemplateProps > = ( args ) => (
31- < PageConstructor
32- content = { {
33- blocks : args . items ,
34- background : data . default . background ,
35- footnotes : data . withFootnotes . footnotes ,
36- } }
37- />
38- ) ;
17+ const WithFootnotesTemplate : Story < PageConstructorProps > = ( args ) => < PageConstructor { ...args } /> ;
18+
19+ const NavigationTemplate : Story < PageConstructorProps > = ( args ) => < PageConstructor { ...args } /> ;
3920
40- const NavigationTemplate : Story < TemplateProps > = ( args ) => (
41- < PageConstructor
42- content = { {
43- blocks : args . items ,
44- } }
45- navigation = { args . navigation }
46- />
21+ const WithFullWidthBackgroundMediaTemplate : Story < PageConstructorProps > = ( args ) => (
22+ < PageConstructor { ...args } />
4723) ;
4824
4925export const Default = DefaultTemplate . bind ( { } ) ;
5026export const WithFootnotes = WithFootnotesTemplate . bind ( { } ) ;
5127export const Navigation = NavigationTemplate . bind ( { } ) ;
52-
53- interface PageConstructorStoryProps {
54- items : HeaderBlockModel [ ] ;
55- navigation ?: NavigationData ;
56- }
57-
58- Default . args = data . default . content as PageConstructorStoryProps ;
59- WithFootnotes . args = data . default . content as PageConstructorStoryProps ;
28+ export const WithFullWidthBackgroundMedia = WithFullWidthBackgroundMediaTemplate . bind ( { } ) ;
29+
30+ Default . args = data . default as PageConstructorProps ;
31+ WithFootnotes . args = {
32+ content : {
33+ ...data . default . content ,
34+ footnotes : data . withFootnotes . footnotes ,
35+ } ,
36+ } as PageConstructorProps ;
6037Navigation . args = {
61- items : data . default . content . items ,
38+ content : {
39+ blocks : data . default . content . blocks ,
40+ } ,
6241 navigation : data . navigation ,
63- } as PageConstructorStoryProps ;
42+ } as PageConstructorProps ;
43+ WithFullWidthBackgroundMedia . args = {
44+ content : {
45+ blocks : data . default . content . blocks ,
46+ background : data . withFullWidthBackgroundMedia . background ,
47+ } ,
48+ } as PageConstructorProps ;
0 commit comments