feat: allow custom logo on auth page (#1818)
This commit is contained in:
committed by
Shawn Erquhart
parent
ede1bad97c
commit
c6ae1e8fc0
@ -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>}
|
||||
|
Reference in New Issue
Block a user