import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Icon from 'netlify-cms-ui-default/Icon'; export default class AuthenticationPage extends React.Component { static propTypes = { onLogin: PropTypes.func.isRequired, inProgress: PropTypes.bool, config: ImmutablePropTypes.map.isRequired, }; componentWillMount() { /** * Allow login screen to be skipped for demo purposes. */ const skipLogin = this.props.config.getIn(['backend', 'login']) === false; if (skipLogin) { this.props.onLogin(this.state); } } handleLogin = (e) => { e.preventDefault(); this.props.onLogin(this.state); }; render() { const { inProgress } = this.props; return (
); } }