diff --git a/src/client/src/LoginPage.js b/src/client/src/LoginPage.js index b99e863..6f075a3 100644 --- a/src/client/src/LoginPage.js +++ b/src/client/src/LoginPage.js @@ -11,7 +11,7 @@ export default function LoginPage(props) { window.location.href = "/"; return; } - + return ( <> diff --git a/src/client/src/ProfilePage.js b/src/client/src/ProfilePage.js index ea63454..16f1ee2 100644 --- a/src/client/src/ProfilePage.js +++ b/src/client/src/ProfilePage.js @@ -1,32 +1,28 @@ import * as React from "react"; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; import Appbar from "./components/AsuraBar"; +import LoginPage from "./LoginPage"; import ErrorSnackbar from "./components/ErrorSnackbar"; import { Button, TextField, Stack, InputLabel, Select, Container, Slider, Paper, Box, Grid, Typography } from '@mui/material'; export default function ProfilePage(props) { let user = props.user; + + if (!props.user.isLoggedIn) { return ; } + return (<> - {user.isLoggedIn ? <> - -
-

Your profile

- -

Name: {user.name}

-

Email: {user.email}

-

Role: {user.isManager ? "Manager" : "Administrator"}

-

Picture: Your profile

-
-
-
- : <> - - You are not logged in. + +
+

Your profile

+ +

Name: {user.name}

+

Email: {user.email}

+

Role: {user.isManager ? "Manager" : "Administrator"}

- } - +
+
) } \ No newline at end of file diff --git a/src/client/src/components/AsuraBar.js b/src/client/src/components/AsuraBar.js index 0bfeef5..6d935bf 100644 --- a/src/client/src/components/AsuraBar.js +++ b/src/client/src/components/AsuraBar.js @@ -29,7 +29,7 @@ function LoggedInMenu(props) { - + { props.user.isManager &&