Compiles.

This commit is contained in:
Paulo Gustavo Veiga 2022-02-25 12:29:17 -08:00
parent 61c4fd9889
commit 7a182418a7

View File

@ -13,6 +13,7 @@ import {
} from '@wisemapping/mindplot'; } from '@wisemapping/mindplot';
import './global-styled.css'; import './global-styled.css';
import I18nMsg from './classes/i18n-msg'; import I18nMsg from './classes/i18n-msg';
import Messages from '@wisemapping/mindplot/src/components/Messages';
declare global { declare global {
// used in mindplot // used in mindplot
@ -75,6 +76,9 @@ const Editor = ({
} }
}, [options.enableKeyboardEvents]); }, [options.enableKeyboardEvents]);
useEffect(() => {
Messages.init(options.locale);
}, [options.locale]);
const onLoadDesigner = (mapId: string, options: EditorOptions, persistenceManager: PersistenceManager): Designer => { const onLoadDesigner = (mapId: string, options: EditorOptions, persistenceManager: PersistenceManager): Designer => {
const buildOptions = DesignerOptionsBuilder.buildOptions({ const buildOptions = DesignerOptionsBuilder.buildOptions({
@ -94,12 +98,14 @@ const Editor = ({
const msg = I18nMsg.loadLocaleData(locale); const msg = I18nMsg.loadLocaleData(locale);
return ( return (
<IntlProvider locale={locale} messages={msg}> <IntlProvider locale={locale} messages={msg}>
<Toolbar {(options.mode !== 'viewonly') &&
isTryMode={options.mode === 'showcase'} <Toolbar
onAction={onAction} editorMode={options.mode}
/> onAction={onAction}
/>
}
<div id="mindplot"></div> <div id="mindplot"></div>
<Footer showTryPanel={options.mode === 'showcase'} /> <Footer editorMode={options.mode} />
</IntlProvider> </IntlProvider>
); );
} }