refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -7,7 +7,7 @@ import DateTime from 'react-datetime';
|
||||
import moment from 'moment';
|
||||
import { buttons } from 'netlify-cms-ui-default';
|
||||
|
||||
const NowButton = ({ t, handleChange }) => {
|
||||
function NowButton({ t, handleChange }) {
|
||||
return (
|
||||
<div
|
||||
css={css`
|
||||
@ -33,7 +33,7 @@ const NowButton = ({ t, handleChange }) => {
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default class DateTimeControl extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -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]),
|
||||
|
@ -2,13 +2,15 @@ import controlComponent from './DateTimeControl';
|
||||
import previewComponent from './DateTimePreview';
|
||||
import schema from './schema';
|
||||
|
||||
const Widget = (opts = {}) => ({
|
||||
name: 'datetime',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
schema,
|
||||
...opts,
|
||||
});
|
||||
function Widget(opts = {}) {
|
||||
return {
|
||||
name: 'datetime',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
schema,
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
export const NetlifyCmsWidgetDatetime = { Widget, controlComponent, previewComponent };
|
||||
export default NetlifyCmsWidgetDatetime;
|
||||
|
Reference in New Issue
Block a user