Added prop type, removed unused console log and import

This commit is contained in:
Alex Holliday committed 2024-07-19 10:44:48 -07:00
1 parent bd2422c90a
commit 903702607d
2 files changed
+4 -4

No files matched your search

-1
View File
@@ -7,7 +7,6 @@ const withAdminCheck = (WrappedComponent) => {
const navigate = useNavigate();
useEffect(() => {
console.log("admin check");
axiosInstance
.get("/auth/users/admin")
.then((response) => {
+4 -3
View File
@@ -3,6 +3,7 @@ import { useNavigate } from "react-router-dom";
import { useTheme } from "@emotion/react";
import { Stack, Typography } from "@mui/material";
import { useDispatch } from "react-redux";
import PropTypes from "prop-types";
import "../index.css";
import background from "../../../assets/Images/background_pattern_decorative.png";
@@ -12,11 +13,9 @@ import Button from "../../../Components/Button";
import { credentials } from "../../../Validation/validation";
import { createToast } from "../../../Utils/toastUtils";
import Field from "../../../Components/Inputs/Field";
import withAdminCheck from "../../../HOC/withAdminCheck";
import { register } from "../../../Features/Auth/authSlice";
const Register = ({ isAdmin }) => {
console.log(isAdmin);
const dispatch = useDispatch();
const navigate = useNavigate();
const theme = useTheme();
@@ -229,5 +228,7 @@ const Register = ({ isAdmin }) => {
</div>
);
};
Register.propTypes = {
isAdmin: PropTypes.bool,
};
export default Register;