13
app/components/Layout/withPageConfig.js
Executable file
13
app/components/Layout/withPageConfig.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { PageConfigContext } from './PageConfigContext';
|
||||
|
||||
export const withPageConfig = (Component) => {
|
||||
const WithPageConfig = (props) => (
|
||||
<PageConfigContext.Consumer>
|
||||
{
|
||||
(pageConfig) => <Component pageConfig={ pageConfig } { ...props } />
|
||||
}
|
||||
</PageConfigContext.Consumer>
|
||||
);
|
||||
return WithPageConfig;
|
||||
};
|
Reference in New Issue
Block a user