1- import React , { useMemo } from 'react' ;
1+ import React , { useContext , useMemo } from 'react' ;
22import _ from 'lodash' ;
33
44import {
@@ -20,9 +20,9 @@ import {
2020 getThemedValue ,
2121 getCustomItems ,
2222} from '../../utils' ;
23- import { withThemeValue , WithThemeValueProps } from '../../context/theme/withThemeValue' ;
2423import { AnimateContext } from '../../context/animateContext' ;
2524import { InnerContext } from '../../context/innerContext' ;
25+ import { ThemeValueContext } from '../../context/theme/ThemeValueContext' ;
2626import { ConstructorRow } from './components/ConstructorRow' ;
2727import { ConstructorFootnotes } from './components/ConstructorFootnotes' ;
2828import { ConstructorHeader } from './components/ConstructorItem' ;
@@ -40,9 +40,7 @@ export interface PageConstructorProps {
4040 renderMenu ?: ( ) => React . ReactNode ;
4141}
4242
43- type Props = PageConstructorProps & WithThemeValueProps ;
44-
45- export const Constructor = ( props : Props ) => {
43+ export const Constructor = ( props : PageConstructorProps ) => {
4644 const { context, headerBlockTypes} = useMemo (
4745 ( ) => ( {
4846 context : {
@@ -59,10 +57,10 @@ export const Constructor = (props: Props) => {
5957 [ props . custom ] ,
6058 ) ;
6159
60+ const { themeValue : theme } = useContext ( ThemeValueContext ) ;
6261 const {
6362 content : { blocks = [ ] , background = { } , footnotes = [ ] } = { } ,
6463 renderMenu,
65- themeValue : theme ,
6664 shouldRenderBlock,
6765 } = props ;
6866
@@ -100,14 +98,12 @@ export const Constructor = (props: Props) => {
10098 ) ;
10199} ;
102100
103- const ThemedConstructor = withThemeValue ( Constructor ) ;
104-
105101export const PageConstructor = ( props : PageConstructorProps ) => {
106102 const { content : { animated = true } = { } , ...rest } = props ;
107103
108104 return (
109105 < AnimateContext . Provider value = { { animated} } >
110- < ThemedConstructor content = { props . content } { ...rest } />
106+ < Constructor content = { props . content } { ...rest } />
111107 </ AnimateContext . Provider >
112108 ) ;
113109} ;
0 commit comments