From dc528e82e381ef386c5a33eb630e126d2ac051fa Mon Sep 17 00:00:00 2001 From: nora-zajzon Date: Thu, 27 Jun 2024 14:01:24 -0700 Subject: [PATCH 1/2] Replaced HTML components with MUI applicable components --- client/src/components/auth/HandleAuth.js | 9 +- client/src/components/user-admin/EditUsers.js | 109 +++++++++--------- 2 files changed, 57 insertions(+), 61 deletions(-) diff --git a/client/src/components/auth/HandleAuth.js b/client/src/components/auth/HandleAuth.js index 4c9d6abb4..240a683f3 100644 --- a/client/src/components/auth/HandleAuth.js +++ b/client/src/components/auth/HandleAuth.js @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'; import { Redirect } from 'react-router-dom'; import { isValidToken } from '../../services/user.service'; import { authLevelRedirect } from '../../utils/authUtils'; +import { Box, Typography, CircularProgress } from '@mui/material'; import '../../sass/MagicLink.scss'; import useAuth from '../../hooks/useAuth'; @@ -43,7 +44,7 @@ const HandleAuth = (props) => { setIsLoaded(true); }, [isMagicLinkValid, setIsLoaded, auth]); - if (!isLoaded) return
Loading...
; + if (!isLoaded) return ; const Delayed = ({ children, waitBeforeShow = 500 }) => { const [isShown, setIsShown] = useState(false); @@ -65,12 +66,12 @@ const HandleAuth = (props) => { } return ( -
+ -
Sorry, the link is not valid anymore.
+ Sorry, the link is not valid anymore.
{auth?.user && /* Redirect to /welcome */} -
+ ); }; diff --git a/client/src/components/user-admin/EditUsers.js b/client/src/components/user-admin/EditUsers.js index 1e5f72e93..e6b873f54 100644 --- a/client/src/components/user-admin/EditUsers.js +++ b/client/src/components/user-admin/EditUsers.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import '../../sass/UserAdmin.scss'; -import { FormGroup, FormControlLabel, Switch } from '@mui/material' +import { FormGroup, FormControlLabel, Switch, Box, Typography, Button, MenuItem, Select, List, ListItem, IconButton } from '@mui/material'; +import DeleteIcon from '@mui/icons-material/Delete'; // child of UserAdmin. Displays form to update users. const EditUsers = ({ userToEdit, backToSearch, updateUserDb, projects, updateUserActiveStatus }) => { @@ -65,74 +66,68 @@ const EditUsers = ({ userToEdit, backToSearch, updateUserDb, projects, updateUse } return ( -
-
-
Name:
-
{userName}
-
-
-
Email:
-
{userEmail}
-
-
-
Is Active:
-
- {isActive.toString()} + + + Name: + {userName} + + + Email: + {userEmail} + + + Is Active: + + {isActive.toString()} - } onClick={() => handleSetIsActive()} /> + } /> -
-
-
-
Projects:
-
-
    - {userProjectsToDisplay.map((result) => { - return ( -
  • - {result[1]} - -
  • - ); - })} -
-
-
-
+ + + + Projects: + + + {userProjectsToDisplay.map((result) => ( + handleRemoveProject(result[0])}> + + + }> + {result[1]} + + ))} + + + +
- - +
-
- -
-
-
+ + + + ); }; From 72f2e99dc1d11a15ca7bfecdc27333cd8af1aede Mon Sep 17 00:00:00 2001 From: nora-zajzon Date: Sun, 7 Jul 2024 10:29:01 -0700 Subject: [PATCH 2/2] Updated HTML components to MUI components --- .../src/components/dashboard/AddTeamMember.js | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/client/src/components/dashboard/AddTeamMember.js b/client/src/components/dashboard/AddTeamMember.js index 61e8143d8..8dca61c9d 100644 --- a/client/src/components/dashboard/AddTeamMember.js +++ b/client/src/components/dashboard/AddTeamMember.js @@ -1,4 +1,5 @@ import React, { useState } from "react"; +import { Box, Button, TextField, Typography } from "@mui/material"; import "../../sass/AddTeamMember.scss"; const AddTeamMember = (props) => { @@ -7,17 +8,17 @@ const AddTeamMember = (props) => { const handleInputChange = (e) => setEmail(e.currentTarget.value); return ( -
-
+ +
props.addToTeamHandler(e, email)} > -
-
- - + + { autoComplete="none" required="required" /> -
-
+ + -
- -
+ +
- {props.isSuccess ?

User Added

: null} -
{props.isError ? props.errorMessage : null}
-
-
+ {props.isSuccess && User Added} + {props.isError && {props.errorMessage}} + + ); };