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

View File

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

View File

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