Added prop type, removed unused console log and import
This commit is contained in:
1 parent
bd2422c90a
commit
903702607d
2 files changed
+4
-4
No files matched your search
@@ -7,7 +7,6 @@ const withAdminCheck = (WrappedComponent) => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("admin check");
|
|
||||||
axiosInstance
|
axiosInstance
|
||||||
.get("/auth/users/admin")
|
.get("/auth/users/admin")
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import "../index.css";
|
import "../index.css";
|
||||||
import background from "../../../assets/Images/background_pattern_decorative.png";
|
import background from "../../../assets/Images/background_pattern_decorative.png";
|
||||||
@@ -12,11 +13,9 @@ import Button from "../../../Components/Button";
|
|||||||
import { credentials } from "../../../Validation/validation";
|
import { credentials } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import withAdminCheck from "../../../HOC/withAdminCheck";
|
|
||||||
import { register } from "../../../Features/Auth/authSlice";
|
import { register } from "../../../Features/Auth/authSlice";
|
||||||
|
|
||||||
const Register = ({ isAdmin }) => {
|
const Register = ({ isAdmin }) => {
|
||||||
console.log(isAdmin);
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -229,5 +228,7 @@ const Register = ({ isAdmin }) => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Register.propTypes = {
|
||||||
|
isAdmin: PropTypes.bool,
|
||||||
|
};
|
||||||
export default Register;
|
export default Register;
|
||||||
Reference in new issue
Block a user