27 lines
821 B
TypeScript
27 lines
821 B
TypeScript
|
|
import React from 'react';
|
||
|
|
import { Editor } from '@craftjs/core';
|
||
|
|
import { EditorShell } from './editor/EditorShell';
|
||
|
|
import { componentResolver } from './components/resolver';
|
||
|
|
import { WhpConfig } from './types';
|
||
|
|
import { EditorConfigProvider } from './state/EditorConfigContext';
|
||
|
|
import { SiteDesignProvider } from './state/SiteDesignContext';
|
||
|
|
import { PageProvider } from './state/PageContext';
|
||
|
|
|
||
|
|
interface AppProps {
|
||
|
|
whpConfig: WhpConfig | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const App: React.FC<AppProps> = ({ whpConfig }) => {
|
||
|
|
return (
|
||
|
|
<EditorConfigProvider config={whpConfig}>
|
||
|
|
<SiteDesignProvider>
|
||
|
|
<Editor resolver={componentResolver} enabled={true}>
|
||
|
|
<PageProvider>
|
||
|
|
<EditorShell />
|
||
|
|
</PageProvider>
|
||
|
|
</Editor>
|
||
|
|
</SiteDesignProvider>
|
||
|
|
</EditorConfigProvider>
|
||
|
|
);
|
||
|
|
};
|