refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -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() {
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user