add pili's fix on Public and Authenticated routes

This commit is contained in:
cleverbeagle 2017-09-07 09:23:28 -05:00
parent 39fc7f09b4
commit f308d32739
2 changed files with 6 additions and 4 deletions

View file

@ -2,9 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Route, Redirect } from 'react-router-dom';
const Authenticated = ({ loggingIn, authenticated, component, ...rest }) => (
const Authenticated = ({ loggingIn, authenticated, component, path, exact, ...rest }) => (
<Route
{...rest}
path={path}
exact={exact}
render={props => (
authenticated ?
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :

View file

@ -2,9 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Route, Redirect } from 'react-router-dom';
const Public = ({ loggingIn, authenticated, component, ...rest }) => (
const Public = ({ loggingIn, authenticated, component, path, exact, ...rest }) => (
<Route
{...rest}
parth={path}
exact={exact}
render={props => (
!authenticated ?
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :