Skip to content

Commit

Permalink
React example : ignore story map type, as the story map engine is not…
Browse files Browse the repository at this point in the history
… supported through SDK
  • Loading branch information
fxi committed May 13, 2024
1 parent 67a9dda commit 6990f92
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions src/examples/app_react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,31 @@ const App = () => {

return e(reactSplitGrid, {
render: ({ getGridProps, getGutterProps }) =>
e("div", { key: "grid", className: "layout grid grid-1x2 grid-sidebar", ...getGridProps() }, [
e(
"div",
{ className: "config padding", key: "colviews" },
e(MxViewsType, { mapx, projectId, views })
),
e("div", {
key: "gutter",
className: "gutter-col gutter-col-1",
...getGutterProps("column", 1),
}),
e("div", {
key: "mapx",
className: "mapx",
ref: mxContainer,
}),
]),
e(
"div",
{
key: "grid",
className: "layout grid grid-1x2 grid-sidebar",
...getGridProps(),
},
[
e(
"div",
{ className: "config padding", key: "colviews" },
e(MxViewsType, { mapx, projectId, views })
),
e("div", {
key: "gutter",
className: "gutter-col gutter-col-1",
...getGutterProps("column", 1),
}),
e("div", {
key: "mapx",
className: "mapx",
ref: mxContainer,
}),
]
),
});
};

Expand Down Expand Up @@ -110,8 +118,12 @@ const MxType = ({ mapx, views, type }) => {

const MxViewsType = ({ mapx, projectId, views }) => {
const types = {};
const supportedTypes = ["vt", "rt", "cc", "gj"];

for (const view of views) {
if (!supportedTypes.includes(view.type)) {
continue;
}
if (!types[view.type]) {
types[view.type] = [view];
} else {
Expand Down

0 comments on commit 6990f92

Please sign in to comment.