feat: allow custom logo on auth page (#1818)

This commit is contained in:
Bartholomew
2018-11-02 18:25:36 +01:00
committed by Shawn Erquhart
parent ede1bad97c
commit c6ae1e8fc0
7 changed files with 56 additions and 6 deletions

View File

@ -1,4 +1,5 @@
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import React from 'react';
import styled from 'react-emotion';
import { partial } from 'lodash';
@ -100,6 +101,7 @@ export default class GitGatewayAuthenticationPage extends React.Component {
onLogin: PropTypes.func.isRequired,
inProgress: PropTypes.bool.isRequired,
error: PropTypes.node,
config: ImmutablePropTypes.map,
};
state = { email: '', password: '', errors: {} };
@ -140,11 +142,12 @@ export default class GitGatewayAuthenticationPage extends React.Component {
render() {
const { errors } = this.state;
const { error, inProgress } = this.props;
const { error, inProgress, config } = this.props;
if (window.netlifyIdentity) {
return (
<AuthenticationPage
logoUrl={config.get('logo_url')}
onLogin={this.handleIdentity}
renderButtonContent={() => 'Login with Netlify Identity'}
/>
@ -153,6 +156,7 @@ export default class GitGatewayAuthenticationPage extends React.Component {
return (
<AuthenticationPage
logoUrl={config.get('logo_url')}
renderPageContent={() => (
<AuthForm onSubmit={this.handleLogin}>
{!error ? null : <ErrorMessage>{error}</ErrorMessage>}