diff --git a/app/(auth)/sign-up/page.jsx b/app/(auth)/sign-up/page.jsx index 9d9ea72..d6b839a 100644 --- a/app/(auth)/sign-up/page.jsx +++ b/app/(auth)/sign-up/page.jsx @@ -3,11 +3,11 @@ import Lottie from "lottie-react"; import logo from "../../../public/logo.json"; import SignUpForm from "@/components/shared/common/Forms/SignUpForm"; import { firebaseAuth } from "@/utils/FirebaseConfig"; -import { useRouter } from "next/navigation"; import { useEffect } from "react"; +import { useRouter } from "next/navigation"; const SignUp = () => { - const router = useRouter(); + const router = useRouter; const currentUser = firebaseAuth.currentUser; useEffect(() => { if (!currentUser) { diff --git a/components/shared/photo/AvatarEdit.jsx b/components/shared/photo/AvatarEdit.jsx index 1a3132e..4c72556 100644 --- a/components/shared/photo/AvatarEdit.jsx +++ b/components/shared/photo/AvatarEdit.jsx @@ -17,10 +17,16 @@ const AvatarEdit = ({ imgURL, setImgURL }) => { const imageRef = useRef(null); const [open, setOpen] = useState(false); const { handleImageChange } = usePrevImg(imgURL, setImgURL); + const [isMobileDevice, setIsMobileDevice] = useState(false); - const isMobileDevice = /Mobi|Android|iPhone|iPad|iPod/i.test( - navigator.userAgent - ); + useEffect(() => { + if (typeof window !== "undefined" && typeof navigator !== "undefined") { + const isMobile = /Mobi|Android|iPhone|iPad|iPod/i.test( + navigator.userAgent + ); + setIsMobileDevice(isMobile); + } + }, []); const handleOpen = () => setOpen(true);