mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00

Previously, the hocs registered with options (ex: registerComponent('Foo', FooComponent, [withBar,barOptions]) ) were not shown in the dashboard from the debug package.
36 lines
735 B
JavaScript
36 lines
735 B
JavaScript
import React from "react";
|
|
import {
|
|
registerComponent,
|
|
Components,
|
|
ComponentsTable
|
|
} from "meteor/vulcan:lib";
|
|
|
|
const ComponentHOCs = ({ document }) => (
|
|
<div>
|
|
<ul>
|
|
{document.hocs.map((hoc, i) => (
|
|
<li key={i}>{typeof hoc.name === "string" ? hoc.name : hoc[0].name}</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
);
|
|
|
|
const ComponentsDashboard = props => (
|
|
<div className="components">
|
|
<Components.Datatable
|
|
showSearch={false}
|
|
showNew={false}
|
|
showEdit={false}
|
|
data={Object.values(ComponentsTable)}
|
|
columns={[
|
|
"name",
|
|
{
|
|
name: "hocs",
|
|
component: ComponentHOCs
|
|
}
|
|
]}
|
|
/>
|
|
</div>
|
|
);
|
|
|
|
registerComponent("Components", ComponentsDashboard);
|