Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export components #169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
.DS_Store
.vscode
.idea
jsconfig.json

react-codemod
Expand Down
43 changes: 29 additions & 14 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
export { chromeLight, chromeDark } from './styles/themes';
import React, { ComponentProps, FC } from 'react';
import isDOM from 'is-dom';

import { ObjectInspector } from './object-inspector/ObjectInspector';
import { TableInspector } from './table-inspector/TableInspector';
import { DOMInspector } from './dom-inspector/DOMInspector';

import { ObjectLabel } from './object-inspector/ObjectLabel';
import { ObjectPreview } from './object-inspector/ObjectPreview';
import { ObjectRootLabel } from './object-inspector/ObjectRootLabel';

import { TableInspector } from './table-inspector/TableInspector';

import { DOMInspector } from './dom-inspector/DOMInspector';
import { DOMNodePreview } from './dom-inspector/DOMNodePreview';

import { ObjectValue } from './object/ObjectValue';
import { ObjectName } from './object/ObjectName';

export { TableInspector, ObjectInspector, ObjectLabel, ObjectPreview, ObjectRootLabel, ObjectValue, ObjectName };
import { TreeView } from './tree-view/TreeView';
import { TreeNode } from './tree-view/TreeNode';

import React, { ComponentProps, FC } from 'react';
import isDOM from 'is-dom';
interface TableInspectorProps extends ComponentProps<typeof TableInspector> {
table: true;
}
interface ObjectInspectorProps extends ComponentProps<typeof ObjectInspector> {
table: false;
}

export const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ table = false, data, ...rest }) => {
const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ table = false, data, ...rest }) => {
if (table) {
return <TableInspector data={data} {...rest} />;
}
Expand All @@ -26,9 +34,16 @@ export const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ tabl
return <ObjectInspector data={data} {...rest} />;
};

interface TableInspectorProps extends ComponentProps<typeof TableInspector> {
table: true;
}
interface ObjectInspectorProps extends ComponentProps<typeof ObjectInspector> {
table: false;
}
export {
DOMNodePreview,
Inspector,
ObjectInspector,
ObjectLabel,
ObjectName,
ObjectPreview,
ObjectRootLabel,
ObjectValue,
TableInspector,
TreeNode,
TreeView,
};