mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-13 02:37:57 +01:00
Move editor page as component
This commit is contained in:
parent
8fbe901c4d
commit
e0a4049d48
@ -15,7 +15,7 @@ import MapsPage from './components/maps-page';
|
|||||||
import CssBaseline from '@material-ui/core/CssBaseline';
|
import CssBaseline from '@material-ui/core/CssBaseline';
|
||||||
import { ThemeProvider } from '@material-ui/core/styles';
|
import { ThemeProvider } from '@material-ui/core/styles';
|
||||||
import GoogleAnalytics from 'react-ga';
|
import GoogleAnalytics from 'react-ga';
|
||||||
import Editor from './components/maps-page/editor';
|
import EditorPage from './components/editor-page';
|
||||||
|
|
||||||
// Google Analytics Initialization.
|
// Google Analytics Initialization.
|
||||||
GoogleAnalytics.initialize('UA-0000000-0');
|
GoogleAnalytics.initialize('UA-0000000-0');
|
||||||
@ -77,11 +77,11 @@ const App = (): ReactElement => {
|
|||||||
component={MapsPage}
|
component={MapsPage}
|
||||||
/>
|
/>
|
||||||
<Route exact path="/c/maps/:id/edit">
|
<Route exact path="/c/maps/:id/edit">
|
||||||
<Editor memoryPersistence={memoryPersistence}
|
<EditorPage memoryPersistence={memoryPersistence}
|
||||||
readOnlyMode={readOnlyMode} mapId={mapId} />
|
readOnlyMode={readOnlyMode} mapId={mapId} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/c/maps/:id/try">
|
<Route exact path="/c/maps/:id/try">
|
||||||
<Editor memoryPersistence={memoryPersistence}
|
<EditorPage memoryPersistence={memoryPersistence}
|
||||||
readOnlyMode={readOnlyMode} mapId={mapId} />
|
readOnlyMode={readOnlyMode} mapId={mapId} />
|
||||||
</Route>
|
</Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ActionDispatcher from '../action-dispatcher';
|
import ActionDispatcher from '../maps-page/action-dispatcher';
|
||||||
import { ActionType } from '../action-chooser';
|
import { ActionType } from '../maps-page/action-chooser';
|
||||||
import WiseEditor from '@wisemapping/editor';
|
import WiseEditor from '@wisemapping/editor';
|
||||||
import AppI18n from '../../../classes/app-i18n';
|
import AppI18n from '../../classes/app-i18n';
|
||||||
|
|
||||||
export type EditorPropsType = {
|
export type EditorPropsType = {
|
||||||
mapId: number;
|
mapId: number;
|
||||||
@ -10,7 +10,7 @@ export type EditorPropsType = {
|
|||||||
readOnlyMode: boolean;
|
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);
|
const [activeDialog, setActiveDialog] = React.useState<ActionType | null>(null);
|
||||||
|
|
||||||
// Load user locale ...
|
// Load user locale ...
|
||||||
@ -31,3 +31,5 @@ export default function Editor({ mapId, ...props }: EditorPropsType): React.Reac
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default EditorPage;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user