diff --git a/src/App.tsx b/src/App.tsx index e7557bc..b63d908 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import { useCallback, useMemo, useRef, useState } from "react"; -import { App as ReactEditorApp } from "@reacteditor/core"; +import { App as ReactEditorApp, createUseEditor } from "@reacteditor/core"; import "@reacteditor/core/react-editor.css"; import createTailwindCdnPlugin from "@reacteditor/plugin-tailwind-cdn"; import { mediaPlugin } from "@reacteditor/plugin-media"; @@ -16,6 +16,8 @@ const AI_API_KEY = (import.meta.env.VITE_API_KEY as string | undefined) ?? ""; type Pages = Record; +const useEditor = createUseEditor(); + const SHOPIFY_DOMAIN = (import.meta.env.VITE_SHOPIFY_DOMAIN as string | undefined) ?? "mock.shop"; const STOREFRONT_TOKEN = @@ -78,21 +80,22 @@ export default function App() { onPublish={handlePublish} onChange={handleChange} overrides={{ - header: ({ children }: any) => ( -
-
{children}
+ headerActions: () => { + const appState = useEditor((s: any) => s.appState); + return ( -
- ), + ); + }, }} />