refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -2,9 +2,9 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { WidgetPreviewContainer } from 'netlify-cms-ui-default';
|
||||
|
||||
const DatePreview = ({ value }) => (
|
||||
<WidgetPreviewContainer>{value ? value.toString() : null}</WidgetPreviewContainer>
|
||||
);
|
||||
function DatePreview({ value }) {
|
||||
return <WidgetPreviewContainer>{value ? value.toString() : null}</WidgetPreviewContainer>;
|
||||
}
|
||||
|
||||
DatePreview.propTypes = {
|
||||
value: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
||||
|
@ -1,12 +1,14 @@
|
||||
import controlComponent from './DateControl';
|
||||
import previewComponent from './DatePreview';
|
||||
|
||||
const Widget = (opts = {}) => ({
|
||||
name: 'date',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
...opts,
|
||||
});
|
||||
function Widget(opts = {}) {
|
||||
return {
|
||||
name: 'date',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
export const NetlifyCmsWidgetDate = { Widget, controlComponent, previewComponent };
|
||||
export default NetlifyCmsWidgetDate;
|
||||
|
Reference in New Issue
Block a user