|
@@ -1,6 +1,9 @@
|
|
|
import React, { useEffect } from 'react';
|
|
import React, { useEffect } from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
+import NavigationContainer from '../../../services/NavigationContainer';
|
|
|
|
|
+import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
+
|
|
|
const EditPage = (props) => {
|
|
const EditPage = (props) => {
|
|
|
|
|
|
|
|
// setup effect
|
|
// setup effect
|
|
@@ -10,6 +13,8 @@ const EditPage = (props) => {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ props.navigationContainer.setEditorMode('edit');
|
|
|
|
|
+
|
|
|
// remove this
|
|
// remove this
|
|
|
props.onDeleteRender(this);
|
|
props.onDeleteRender(this);
|
|
|
}, [props]);
|
|
}, [props]);
|
|
@@ -18,11 +23,14 @@ const EditPage = (props) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
EditPage.propTypes = {
|
|
EditPage.propTypes = {
|
|
|
|
|
+ navigationContainer: PropTypes.instanceOf(NavigationContainer).isRequired,
|
|
|
onDeleteRender: PropTypes.func.isRequired,
|
|
onDeleteRender: PropTypes.func.isRequired,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-EditPage.getHotkeyStrokes = () => {
|
|
|
|
|
|
|
+const EditPageWrapper = withUnstatedContainers(EditPage, [NavigationContainer]);
|
|
|
|
|
+
|
|
|
|
|
+EditPageWrapper.getHotkeyStrokes = () => {
|
|
|
return [['e']];
|
|
return [['e']];
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-export default EditPage;
|
|
|
|
|
|
|
+export default EditPageWrapper;
|