Abstract notif component for auth pages.

This commit is contained in:
Caleb 2017-10-26 20:15:54 -06:00
parent 01d7d61efb
commit 035b02bd24
3 changed files with 3 additions and 6 deletions

View File

@ -1,8 +1,7 @@
import PropTypes from 'prop-types';
import React from "react";
import { partial } from 'lodash';
import { Notifs } from 'redux-notifications';
import { Toast, Icon } from 'UI';
import { Icon } from 'UI';
let component = null;
@ -92,7 +91,6 @@ export default class AuthenticationPage extends React.Component {
if (window.netlifyIdentity) {
return <section className="nc-gitGatewayAuthenticationPage-root">
<Notifs CustomComponent={Toast} />
<Icon className="nc-githubAuthenticationPage-logo" size="500px" type="netlify-cms"/>
<button className="nc-githubAuthenticationPage-button" onClick={this.handleIdentity}>
Login with Netlify Identity

View File

@ -1,8 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import Authenticator from 'Lib/netlify-auth';
import { Notifs } from 'redux-notifications';
import { Icon, Toast } from 'UI';
import { Icon } from 'UI';
export default class AuthenticationPage extends React.Component {
static propTypes = {
@ -36,7 +35,6 @@ export default class AuthenticationPage extends React.Component {
return (
<section className="nc-githubAuthenticationPage-root">
<Icon className="nc-githubAuthenticationPage-logo" size="500px" type="netlify-cms"/>
<Notifs CustomComponent={Toast} />
{loginError && <p>{loginError}</p>}
<button
className="nc-githubAuthenticationPage-button"

View File

@ -75,6 +75,7 @@ class App extends React.Component {
return (
<div>
<Notifs CustomComponent={Toast} />
{
React.createElement(backend.authComponent(), {
onLogin: this.handleLogin.bind(this),