WIP Frontend development.

This commit is contained in:
Ahmed Bouhuolia
2020-02-18 02:31:42 +02:00
parent e5c78fe555
commit a37341ff00
24 changed files with 364 additions and 80 deletions

View File

@@ -5,23 +5,25 @@ import authenticationRoutes from 'routes/authentication';
export default function({ isAuthenticated =false, ...rest }) {
const to = {pathname: '/dashboard/homepage'};
return isAuthenticated ?
(
<Redirect to={to} />
) : (
<Switch>
<div class="authentication-page">
<div class="authentication-page__form-wrapper">
{ authenticationRoutes.map((route, index) => (
<Route
key={index}
path={route.path}
exact={route.exact}
component={route.component}
/>
))}
</div>
</div>
</Switch>
return (
<Route path="/auth">
{ isAuthenticated ?
(<Redirect to={to} />) : (
<Switch>
<div class="authentication-page">
<div class="authentication-page__form-wrapper">
{ authenticationRoutes.map((route, index) => (
<Route
key={index}
path={route.path}
exact={route.exact}
component={route.component}
/>
))}
</div>
</div>
</Switch>)
}
</Route>
);
}