- {userName}
+ <>
+
+
+ {userName}
- {userAvatar ?
UI :
}
-
- )
+ {userAvatar ? (
+
+ ) : (
+
+ {userName.charAt(0)}
+
+ )}
+
+ >
+ );
}
-export default UserProfile
\ No newline at end of file
+export default UserProfile;
diff --git a/src/pages/Authentication/Login.jsx b/src/pages/Authentication/Login.jsx
index e02404c3..eb6f0fa1 100644
--- a/src/pages/Authentication/Login.jsx
+++ b/src/pages/Authentication/Login.jsx
@@ -4,8 +4,8 @@ import { useNavigate, Link } from "react-router-dom";
import { useForm } from "react-hook-form";
import loginImg from "../../assets/register.jpg";
import { PasswordIcon, MailIcon } from "../../assets/RegisterIcons";
-import VisibilityIcon from "@mui/icons-material/Visibility";
-import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
+import { MdOutlineRemoveRedEye } from "react-icons/md";
+import { AiOutlineEyeInvisible } from "react-icons/ai";
import { useTheme } from "../../context/ThemeContext";
import "./auth.css";
import { useAppContext } from "../../context/AppContext";
@@ -23,15 +23,11 @@ const Login = () => {
handleSubmit,
formState: { errors },
} = useForm();
-
+
const apiUrl = import.meta.env.VITE_API_URL;
const { mutate: loginUserMutate, isPending: isLoginPending } = useMutation({
- mutationFn: (user) =>
- axios.post(
- `${apiUrl}/api/users/login`,
- user
- ),
+ mutationFn: (user) => axios.post(`${apiUrl}/api/users/login`, user),
});
const onSubmit = handleSubmit(({ email, password }) => {
@@ -94,11 +90,15 @@ const Login = () => {
})}
/>
setShowPassword(!showPassword)}
>
- {showPassword ? : }
+ {showPassword ? (
+
+ ) : (
+
+ )}
{errors.password && (
diff --git a/src/pages/Authentication/Register.jsx b/src/pages/Authentication/Register.jsx
index 942fe64e..8af5c76b 100644
--- a/src/pages/Authentication/Register.jsx
+++ b/src/pages/Authentication/Register.jsx
@@ -3,8 +3,8 @@ import axios from "axios";
import { useNavigate, Link } from "react-router-dom";
import { useForm } from "react-hook-form";
import registerImg from "../../assets/register.jpg";
-import VisibilityIcon from "@mui/icons-material/Visibility";
-import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
+import { MdOutlineRemoveRedEye } from "react-icons/md";
+import { AiOutlineEyeInvisible } from "react-icons/ai";
import {
UsernameIcon,
PasswordIcon,
@@ -30,16 +30,12 @@ const Register = () => {
handleSubmit,
formState: { errors },
} = useForm();
-
+
const apiUrl = import.meta.env.VITE_API_URL;
const { mutate: registerUserMutate, isPending: isRegisterPending } =
useMutation({
- mutationFn: (user) =>
- axios.post(
- `${apiUrl}/api/users/register`,
- user
- ),
+ mutationFn: (user) => axios.post(`${apiUrl}/api/users/register`, user),
});
const onSubmit = handleSubmit(
@@ -155,11 +151,15 @@ const Register = () => {
})}
/>