mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 03:33:48 +01:00
Merged in bugfix/add-hook-to-webapp (pull request #76)
fix: add custom hook useEditor to webapp package * fix: add custom hook useEditor to webapp package
This commit is contained in:
parent
7434277373
commit
7a4b5212d9
@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { useEffect } from 'react';
|
||||
import Editor, { EditorOptions } from '@wisemapping/editor';
|
||||
import Editor, { useEditor, EditorOptions } from '@wisemapping/editor';
|
||||
import {
|
||||
EditorRenderMode,
|
||||
PersistenceManager,
|
||||
@ -173,6 +173,12 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
|
||||
}
|
||||
}, [mapInfo?.getTitle()]);
|
||||
|
||||
const editor = useEditor({
|
||||
mapInfo,
|
||||
options,
|
||||
persistenceManager: persistence,
|
||||
});
|
||||
|
||||
return loadCompleted ? (
|
||||
<IntlProvider
|
||||
locale={userLocale.code}
|
||||
@ -181,10 +187,8 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
|
||||
>
|
||||
<ClientHealthSentinel />
|
||||
<Editor
|
||||
editor={editor}
|
||||
onAction={setActiveDialog}
|
||||
options={options}
|
||||
persistenceManager={persistence}
|
||||
mapInfo={mapInfo}
|
||||
theme={theme}
|
||||
accountConfiguration={
|
||||
// Prevent load on non-authenticated.
|
||||
|
Loading…
Reference in New Issue
Block a user