diff --git a/components/modal/auth/AuthInputs.tsx b/components/modal/auth/AuthInputs.tsx index d6abf8f..aa5268f 100644 --- a/components/modal/auth/AuthInputs.tsx +++ b/components/modal/auth/AuthInputs.tsx @@ -20,7 +20,7 @@ const AuthInputs: React.FC = () => { const modalState = useAtomValue(authModalStateAtom); return ( - + {modalState.view === "login" && } {modalState.view === "signup" && } diff --git a/components/modal/auth/AuthModal.tsx b/components/modal/auth/AuthModal.tsx index c7f0644..87f0c66 100644 --- a/components/modal/auth/AuthModal.tsx +++ b/components/modal/auth/AuthModal.tsx @@ -14,6 +14,7 @@ import { DialogTitle, Flex, Separator, + Box, } from "@chakra-ui/react"; import { useAtom } from "jotai"; import React, { useEffect } from "react"; @@ -92,12 +93,12 @@ const AuthModal: React.FC = () => { > {/* If user is trying to authenticate (log in or sign up) */} {modalState.view === "login" || modalState.view === "signup" ? ( - <> + {/* OR */} - + ) : ( // If user is trying to reset password diff --git a/components/modal/auth/Login.tsx b/components/modal/auth/Login.tsx index c60fa5a..bfcc5d5 100644 --- a/components/modal/auth/Login.tsx +++ b/components/modal/auth/Login.tsx @@ -45,7 +45,13 @@ const Login: React.FC = () => { }; return ( -
+ { + e.preventDefault(); + handleSubmit(onSubmit)(e); + }} + style={{ width: "100%" }} + > {errors.email && ( @@ -94,7 +100,8 @@ const Login: React.FC = () => { height="36px" mt={2} mb={2} - type="submit" + type="button" + onClick={handleSubmit(onSubmit)} loading={loading} disabled={!isValid} > diff --git a/components/modal/auth/ResetPassword.tsx b/components/modal/auth/ResetPassword.tsx index e68e7e5..81cfeac 100644 --- a/components/modal/auth/ResetPassword.tsx +++ b/components/modal/auth/ResetPassword.tsx @@ -1,4 +1,4 @@ -import { Button, Flex, Icon, Image, Input, Text } from "@chakra-ui/react"; +import { Button, Flex, Icon, Image, Input, Text, Box } from "@chakra-ui/react"; import { useSetAtom } from "jotai"; import React, { useState } from "react"; import { useSendPasswordResetEmail } from "react-firebase-hooks/auth"; @@ -38,12 +38,12 @@ const ResetPassword: React.FC = () => { {success ? ( Check your email ) : ( - <> + Enter the email associated with your account and we will send you a reset link - + { e.preventDefault(); handleSubmit(onSubmit)(e); }} style={{ width: "100%" }}> { > {error?.message} - - + )} { }; return ( -
+ { + e.preventDefault(); + handleSubmit(onSubmit)(e); + }} + style={{ width: "100%" }} + > {errors.email && ( @@ -106,7 +112,8 @@ const SignUp = () => { height="36px" mt={2} mb={2} - type="submit" + type="button" + onClick={handleSubmit(onSubmit)} loading={loading} disabled={!isValid} > diff --git a/components/posts/comments/CommentInput.tsx b/components/posts/comments/CommentInput.tsx index f26b88a..00a041a 100644 --- a/components/posts/comments/CommentInput.tsx +++ b/components/posts/comments/CommentInput.tsx @@ -1,6 +1,6 @@ import ProfileModal from "@/components/modal/profile/ProfileModal"; import AuthButtons from "@/components/navbar/right-content/AuthButtons"; -import { Flex, Textarea, Button, Text, Stack, Icon } from "@chakra-ui/react"; +import { Flex, Textarea, Button, Text, Stack, Icon, Box } from "@chakra-ui/react"; import { LuSend, LuTrash } from "react-icons/lu"; import { User } from "firebase/auth"; import React, { useState } from "react"; @@ -37,6 +37,7 @@ const CommentInput: React.FC = ({ const commentText = watch("text"); const onSubmit = (data: CommentInputType) => { + console.log("Submitting comment:", data.text); onCreateComment(data.text); reset(); }; @@ -44,7 +45,7 @@ const CommentInput: React.FC = ({ return ( {user ? ( - <> + setProfileModalOpen(false)} open={isProfileModalOpen} @@ -67,7 +68,7 @@ const CommentInput: React.FC = ({ - + { e.preventDefault(); handleSubmit(onSubmit)(e); }}> = ({ disabled={!isValid} loading={createLoading} borderRadius={"xl"} - type="submit" + type="button" + onClick={handleSubmit(onSubmit)} height={"36px"} > @@ -134,7 +136,7 @@ const CommentInput: React.FC = ({ - + ) : (