home page layout

This commit is contained in:
Ruidy Nemausat 2020-05-05 19:19:12 +02:00
parent cf9c80f6b1
commit 17f67ccebf
4 changed files with 17 additions and 3 deletions

BIN
app.db

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,7 +1,20 @@
import React, { FC } from "react";
import { Redirect } from "react-router-dom";
import SignInSide from "../components/SignInSide";
import { useAuth0 } from "../authentication/auth0";
import { getUID } from "../authentication/helpers";
import * as ROUTES from "../constants/routes";
const HomePage: FC = () => {
return <div>HomePage</div>;
const { isAuthenticated, user } = useAuth0();
if (isAuthenticated) {
// retrieve userId
const uid = getUID(user);
return <Redirect to={`${ROUTES.USERS}/${uid}`} />;
} else {
return <SignInSide />;
}
};
export default HomePage;

View file

@ -7,7 +7,7 @@ import UserController from "../controllers/UserController";
import TicketController from "../controllers/TicketController";
import NotFoundPage from "../pages/NotFoundPage";
import TestPage from "../pages/TestPage";
import SigninPage from "../pages/SigninPage";
// import SigninPage from "../pages/SigninPage";
import * as ROUTES from "../constants/routes";
const AppRouter = () => {
@ -15,7 +15,7 @@ const AppRouter = () => {
<Switch>
<PrivateRoute path={ROUTES.TEST} component={TestPage} />
<Route exact path={ROUTES.HOME} component={HomeController} />
<Route path={ROUTES.SIGN_IN} component={SigninPage} />
{/* <Route path={ROUTES.SIGN_IN} component={SigninPage} /> */}
<PrivateRoute
path={`${ROUTES.PROJECTS}/:id`}
component={ProjectController}