Skip to content

Commit c1b8e45

Browse files
authored
feat: add default analytics context to header block (#289)
* feat: add default analytics context to header block
1 parent 04c9ad0 commit c1b8e45

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/containers/PageConstructor/PageConstructor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {ThemeValueContext} from '../../context/theme/ThemeValueContext';
1010
import {Grid} from '../../grid';
1111
import {
1212
Block,
13+
BlockType,
1314
BlockTypes,
1415
CustomConfig,
1516
CustomItems,
@@ -91,7 +92,9 @@ export const Constructor = (props: PageConstructorProps) => {
9192
)}
9293
<Layout navigation={navigation}>
9394
{renderMenu && renderMenu()}
94-
{header && <ConstructorHeader data={header} />}
95+
{header && (
96+
<ConstructorHeader data={header} blockKey={BlockType.HeaderBlock} />
97+
)}
9598
<Grid>
9699
{restBlocks && (
97100
<ConstructorRow>

src/containers/PageConstructor/components/ConstructorItem/ConstructorItem.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ import {ConstructorItem as ConstructorItemType, WithChildren} from '../../../../
66

77
export interface ConstructorItemProps {
88
data: ConstructorItemType;
9-
blockKey?: string;
9+
blockKey: string;
1010
}
1111

12-
export const ConstructorItem = ({
13-
data,
14-
blockKey = '',
15-
children,
16-
}: WithChildren<ConstructorItemProps>) => {
12+
export const ConstructorItem = ({data, blockKey, children}: WithChildren<ConstructorItemProps>) => {
1713
const {itemMap} = useContext(InnerContext);
1814
const {type, ...rest} = data;
1915

@@ -30,7 +26,7 @@ export const ConstructorItem = ({
3026

3127
export const ConstructorHeader = ({
3228
data,
33-
blockKey = '',
29+
blockKey,
3430
}: Pick<ConstructorItemProps, 'data' | 'blockKey'>) => (
3531
<ConstructorItem data={data} key={data.type} blockKey={blockKey} />
3632
);

0 commit comments

Comments
 (0)