refactor: JSON editing for NoTrait
This commit is contained in:
parent
d7c93d591d
commit
00c1da7420
|
@ -6,6 +6,7 @@ import {
|
||||||
React,
|
React,
|
||||||
useLatus,
|
useLatus,
|
||||||
} from '@latus/react';
|
} from '@latus/react';
|
||||||
|
import {JsonResourceController} from '@persea/json';
|
||||||
import {
|
import {
|
||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
Tabs,
|
||||||
|
@ -13,15 +14,12 @@ import {
|
||||||
TabPanel,
|
TabPanel,
|
||||||
} from 'react-tabs';
|
} from 'react-tabs';
|
||||||
|
|
||||||
const NoTraitRenderer = ({json}) => (
|
const NoTraitRenderer = ({path, json}) => (
|
||||||
<pre>
|
<JsonResourceController.Component path={path} resource={json} />
|
||||||
<code>
|
|
||||||
{JSON.stringify(json, null, 2)}
|
|
||||||
</code>
|
|
||||||
</pre>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
NoTraitRenderer.propTypes = {
|
NoTraitRenderer.propTypes = {
|
||||||
|
path: PropTypes.string.isRequired,
|
||||||
json: PropTypes.shape({}).isRequired,
|
json: PropTypes.shape({}).isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user