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.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import Editor, { EditorOptions } from '@wisemapping/editor';
|
import Editor, { useEditor, EditorOptions } from '@wisemapping/editor';
|
||||||
import {
|
import {
|
||||||
EditorRenderMode,
|
EditorRenderMode,
|
||||||
PersistenceManager,
|
PersistenceManager,
|
||||||
@ -173,6 +173,12 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
|
|||||||
}
|
}
|
||||||
}, [mapInfo?.getTitle()]);
|
}, [mapInfo?.getTitle()]);
|
||||||
|
|
||||||
|
const editor = useEditor({
|
||||||
|
mapInfo,
|
||||||
|
options,
|
||||||
|
persistenceManager: persistence,
|
||||||
|
});
|
||||||
|
|
||||||
return loadCompleted ? (
|
return loadCompleted ? (
|
||||||
<IntlProvider
|
<IntlProvider
|
||||||
locale={userLocale.code}
|
locale={userLocale.code}
|
||||||
@ -181,10 +187,8 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
|
|||||||
>
|
>
|
||||||
<ClientHealthSentinel />
|
<ClientHealthSentinel />
|
||||||
<Editor
|
<Editor
|
||||||
|
editor={editor}
|
||||||
onAction={setActiveDialog}
|
onAction={setActiveDialog}
|
||||||
options={options}
|
|
||||||
persistenceManager={persistence}
|
|
||||||
mapInfo={mapInfo}
|
|
||||||
theme={theme}
|
theme={theme}
|
||||||
accountConfiguration={
|
accountConfiguration={
|
||||||
// Prevent load on non-authenticated.
|
// Prevent load on non-authenticated.
|
||||||
|
Loading…
Reference in New Issue
Block a user