diff --git a/es/components/static-pages/StaticPageBase.js b/es/components/static-pages/StaticPageBase.js
index 8b238cdd..8fa6d285 100644
--- a/es/components/static-pages/StaticPageBase.js
+++ b/es/components/static-pages/StaticPageBase.js
@@ -224,32 +224,8 @@ export var StaticPageBase = /*#__PURE__*/function (_React$PureComponent2) {
key: "render",
value: function render() {
var _this$props2 = this.props,
- _this$props2$context = _this$props2.context,
- context = _this$props2$context === void 0 ? {
- title: "Page Title",
- content: {
- sectionNameID1: {
- order: 0,
- title: "Section Title 1",
- content: "
Hello
",
- filetype: "html"
- },
- sectionNameID2: {
- order: 1,
- title: "Section Title 2",
- content: "World
",
- filetype: "html"
- }
- }
- } : _this$props2$context,
- _this$props2$entryRen = _this$props2.entryRenderFxn,
- entryRenderFxn = _this$props2$entryRen === void 0 ? memoize(function (sectionName, section, props) {
- return /*#__PURE__*/React.createElement(StaticEntry, _extends({}, props, {
- key: sectionName,
- sectionName: sectionName,
- section: section
- }));
- }) : _this$props2$entryRen,
+ context = _this$props2.context,
+ entryRenderFxn = _this$props2.entryRenderFxn,
contentParseFxn = _this$props2.contentParseFxn,
CustomWrapper = _this$props2.CustomWrapper;
var parsedContent = null;
@@ -298,6 +274,39 @@ export var StaticPageBase = /*#__PURE__*/function (_React$PureComponent2) {
}]);
}(React.PureComponent);
_defineProperty(StaticPageBase, "Wrapper", Wrapper);
+_defineProperty(StaticPageBase, "defaultProps", {
+ "context": {
+ "title": "Page Title",
+ "content": {
+ "sectionNameID1": {
+ "order": 0,
+ "title": "Section Title 1",
+ "content": "Hello
",
+ "filetype": "html"
+ },
+ "sectionNameID2": {
+ "order": 1,
+ "title": "Section Title 2",
+ "content": "World
",
+ "filetype": "html"
+ }
+ }
+ },
+ /**
+ * Default function for rendering out parsed section(s) content.
+ *
+ * @param {string} sectionName - Unique identifier of the section. Use to navigate to via '#' in URL.
+ * @param {{ content : string|JSX.Element }} section - Object with parsed content, title, etc.
+ * @param {Object} props - Collection of props passed down from BodyElement.
+ */
+ 'entryRenderFxn': memoize(function (sectionName, section, props) {
+ return /*#__PURE__*/React.createElement(StaticEntry, _extends({}, props, {
+ key: sectionName,
+ sectionName: sectionName,
+ section: section
+ }));
+ })
+});
_defineProperty(StaticPageBase, "propTypes", {
'context': PropTypes.shape({
"title": PropTypes.string,
diff --git a/src/components/static-pages/StaticPageBase.js b/src/components/static-pages/StaticPageBase.js
index b24d4f84..41041817 100644
--- a/src/components/static-pages/StaticPageBase.js
+++ b/src/components/static-pages/StaticPageBase.js
@@ -203,6 +203,38 @@ export class StaticPageBase extends React.PureComponent {
);
}
+ static defaultProps = {
+ "context" : {
+ "title" : "Page Title",
+ "content" : {
+ "sectionNameID1" : {
+ "order" : 0,
+ "title" : "Section Title 1",
+ "content" : "Hello
",
+ "filetype" : "html"
+ },
+ "sectionNameID2" : {
+ "order" : 1,
+ "title" : "Section Title 2",
+ "content" : "World
",
+ "filetype" : "html"
+ }
+ }
+ },
+
+ /**
+ * Default function for rendering out parsed section(s) content.
+ *
+ * @param {string} sectionName - Unique identifier of the section. Use to navigate to via '#' in URL.
+ * @param {{ content : string|JSX.Element }} section - Object with parsed content, title, etc.
+ * @param {Object} props - Collection of props passed down from BodyElement.
+ */
+ 'entryRenderFxn' : memoize(function(sectionName, section, props){
+ return (
+
+ );
+ })
+ };
static propTypes = {
'context' : PropTypes.shape({
@@ -217,30 +249,7 @@ export class StaticPageBase extends React.PureComponent {
};
render() {
- const {
- context = {
- title: "Page Title",
- content: {
- sectionNameID1: {
- order: 0,
- title: "Section Title 1",
- content: "Hello
",
- filetype: "html"
- },
- sectionNameID2: {
- order: 1,
- title: "Section Title 2",
- content: "World
",
- filetype: "html"
- }
- }
- },
- entryRenderFxn = memoize((sectionName, section, props) => (
-
- )),
- contentParseFxn,
- CustomWrapper
- } = this.props;
+ const { context, entryRenderFxn, contentParseFxn, CustomWrapper } = this.props;
let parsedContent = null;
try {