refactor: convert function expressions to declarations (#4926)

This commit is contained in:
Vladislav Shkodin
2021-02-08 20:01:21 +02:00
committed by GitHub
parent c0236536dd
commit 141a2eba56
241 changed files with 3444 additions and 2933 deletions

View File

@ -4,14 +4,16 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { css } from '@emotion/core';
import { Toggle, ToggleBackground, colors } from 'netlify-cms-ui-default';
const BooleanBackground = ({ isActive, ...props }) => (
<ToggleBackground
css={css`
background-color: ${isActive ? colors.active : colors.textFieldBorder};
`}
{...props}
/>
);
function BooleanBackground({ isActive, ...props }) {
return (
<ToggleBackground
css={css`
background-color: ${isActive ? colors.active : colors.textFieldBorder};
`}
{...props}
/>
);
}
export default class BooleanControl extends React.Component {
render() {

View File

@ -1,10 +1,12 @@
import controlComponent from './BooleanControl';
const Widget = (opts = {}) => ({
name: 'boolean',
controlComponent,
...opts,
});
function Widget(opts = {}) {
return {
name: 'boolean',
controlComponent,
...opts,
};
}
export const NetlifyCmsWidgetBoolean = { Widget, controlComponent };
export default NetlifyCmsWidgetBoolean;