refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -2,11 +2,13 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { WidgetPreviewContainer } from 'netlify-cms-ui-default';
|
||||
|
||||
const ObjectPreview = ({ field }) => (
|
||||
<WidgetPreviewContainer>
|
||||
{(field && field.get('fields')) || field.get('field') || null}
|
||||
</WidgetPreviewContainer>
|
||||
);
|
||||
function ObjectPreview({ field }) {
|
||||
return (
|
||||
<WidgetPreviewContainer>
|
||||
{(field && field.get('fields')) || field.get('field') || null}
|
||||
</WidgetPreviewContainer>
|
||||
);
|
||||
}
|
||||
|
||||
ObjectPreview.propTypes = {
|
||||
field: PropTypes.node,
|
||||
|
@ -2,13 +2,15 @@ import controlComponent from './ObjectControl';
|
||||
import previewComponent from './ObjectPreview';
|
||||
import schema from './schema';
|
||||
|
||||
const Widget = (opts = {}) => ({
|
||||
name: 'object',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
schema,
|
||||
...opts,
|
||||
});
|
||||
function Widget(opts = {}) {
|
||||
return {
|
||||
name: 'object',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
schema,
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
export const NetlifyCmsWidgetObject = { Widget, controlComponent, previewComponent };
|
||||
export default NetlifyCmsWidgetObject;
|
||||
|
Reference in New Issue
Block a user