From 5b44e46d312cc16b77f963602b76cf27fcf73368 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 24 Apr 2022 14:48:38 +0200 Subject: [PATCH] Visual updates --- src/client/src/LoginPage.js | 2 +- src/client/src/ProfilePage.js | 30 ++++++++++++--------------- src/client/src/components/AsuraBar.js | 2 +- 3 files changed, 15 insertions(+), 19 deletions(-) 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 &&