catalog: finalize port to new composability API + tweak dev-utils

This commit is contained in:
Patrik Oldsberg
2021-02-02 15:07:33 +01:00
parent d941f6187b
commit b37501a3d1
9 changed files with 73 additions and 48 deletions
+8 -1
View File
@@ -38,6 +38,7 @@ import SentimentDissatisfiedIcon from '@material-ui/icons/SentimentDissatisfied'
const GatheringRoute: (props: {
path: string;
element: JSX.Element;
children?: ReactNode;
}) => JSX.Element = ({ element }) => element;
attachComponentData(GatheringRoute, 'core.gatherMountPoints', true);
@@ -45,6 +46,7 @@ attachComponentData(GatheringRoute, 'core.gatherMountPoints', true);
type RegisterPageOptions = {
path?: string;
element: JSX.Element;
children?: JSX.Element;
title?: string;
icon?: IconComponent;
};
@@ -112,7 +114,12 @@ class DevAppBuilder {
);
}
this.routes.push(
<GatheringRoute key={path} path={path} element={opts.element} />,
<GatheringRoute
key={path}
path={path}
element={opts.element}
children={opts.children}
/>,
);
return this;
}