Move editor page as component

This commit is contained in:
Paulo Gustavo Veiga 2022-02-05 15:09:43 -08:00
parent 8fbe901c4d
commit e0a4049d48
2 changed files with 9 additions and 7 deletions

View File

@ -15,7 +15,7 @@ import MapsPage from './components/maps-page';
import CssBaseline from '@material-ui/core/CssBaseline';
import { ThemeProvider } from '@material-ui/core/styles';
import GoogleAnalytics from 'react-ga';
import Editor from './components/maps-page/editor';
import EditorPage from './components/editor-page';
// Google Analytics Initialization.
GoogleAnalytics.initialize('UA-0000000-0');
@ -77,11 +77,11 @@ const App = (): ReactElement => {
component={MapsPage}
/>
<Route exact path="/c/maps/:id/edit">
<Editor memoryPersistence={memoryPersistence}
<EditorPage memoryPersistence={memoryPersistence}
readOnlyMode={readOnlyMode} mapId={mapId} />
</Route>
<Route exact path="/c/maps/:id/try">
<Editor memoryPersistence={memoryPersistence}
<EditorPage memoryPersistence={memoryPersistence}
readOnlyMode={readOnlyMode} mapId={mapId} />
</Route>
</Switch>

View File

@ -1,8 +1,8 @@
import React from 'react';
import ActionDispatcher from '../action-dispatcher';
import { ActionType } from '../action-chooser';
import ActionDispatcher from '../maps-page/action-dispatcher';
import { ActionType } from '../maps-page/action-chooser';
import WiseEditor from '@wisemapping/editor';
import AppI18n from '../../../classes/app-i18n';
import AppI18n from '../../classes/app-i18n';
export type EditorPropsType = {
mapId: number;
@ -10,7 +10,7 @@ export type EditorPropsType = {
readOnlyMode: boolean;
};
export default function Editor({ mapId, ...props }: EditorPropsType): React.ReactElement {
const EditorPage = ({ mapId, ...props }: EditorPropsType): React.ReactElement => {
const [activeDialog, setActiveDialog] = React.useState<ActionType | null>(null);
// Load user locale ...
@ -31,3 +31,5 @@ export default function Editor({ mapId, ...props }: EditorPropsType): React.Reac
</>
}
export default EditorPage;