add pili's fix on Public and Authenticated routes
This commit is contained in:
parent
39fc7f09b4
commit
f308d32739
2 changed files with 6 additions and 4 deletions
|
|
@ -2,9 +2,10 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Route, Redirect } from 'react-router-dom';
|
import { Route, Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
const Authenticated = ({ loggingIn, authenticated, component, ...rest }) => (
|
const Authenticated = ({ loggingIn, authenticated, component, path, exact, ...rest }) => (
|
||||||
<Route
|
<Route
|
||||||
{...rest}
|
path={path}
|
||||||
|
exact={exact}
|
||||||
render={props => (
|
render={props => (
|
||||||
authenticated ?
|
authenticated ?
|
||||||
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :
|
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Route, Redirect } from 'react-router-dom';
|
import { Route, Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
const Public = ({ loggingIn, authenticated, component, ...rest }) => (
|
const Public = ({ loggingIn, authenticated, component, path, exact, ...rest }) => (
|
||||||
<Route
|
<Route
|
||||||
{...rest}
|
parth={path}
|
||||||
|
exact={exact}
|
||||||
render={props => (
|
render={props => (
|
||||||
!authenticated ?
|
!authenticated ?
|
||||||
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :
|
(React.createElement(component, { ...props, ...rest, loggingIn, authenticated })) :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue