feat: upgrade to Emotion 10 (#2166)

This commit is contained in:
Shawn Erquhart
2019-03-15 10:19:57 -04:00
committed by GitHub
parent 7d6992e464
commit ccef446d72
109 changed files with 4672 additions and 3875 deletions

View File

@ -21,11 +21,11 @@
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.16.1",
"webpack-cli": "^3.1.0"
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"emotion": "^9.2.6",
"@emotion/core": "^10.0.9",
"lodash": "^4.17.10",
"netlify-cms-ui-default": "^2.0.0",
"prop-types": "^15.5.10",

View File

@ -1,12 +1,18 @@
/** @jsx jsx */
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import styled from 'react-emotion';
import { jsx, css } from '@emotion/core';
import { Toggle, ToggleBackground, colors } from 'netlify-cms-ui-default';
const BooleanBackground = styled(ToggleBackground)`
background-color: ${props => (props.isActive ? colors.active : colors.textFieldBorder)};
`;
const BooleanBackground = ({ isActive, ...props }) => (
<ToggleBackground
css={css`
background-color: ${isActive ? colors.active : colors.textFieldBorder};
`}
{...props}
/>
);
export default class BooleanControl extends React.Component {
render() {