diff --git a/assets/dropform-png.png b/assets/dropform-png.png new file mode 100644 index 0000000..d882a30 Binary files /dev/null and b/assets/dropform-png.png differ diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..b665b67 --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Dashboard/DashboardCard.jsx b/src/Dashboard/DashboardCard.jsx index 67403ea..23359fa 100644 --- a/src/Dashboard/DashboardCard.jsx +++ b/src/Dashboard/DashboardCard.jsx @@ -37,7 +37,9 @@ const DashboardCard = ({ formData }) => { // onClick={() => currentFormDetails(formData)} >
-

{formData.form_name}

+

+ {formData.form_name} +

diff --git a/src/Editor/InputSettings.jsx b/src/Editor/InputSettings.jsx index 861469a..60abfe4 100644 --- a/src/Editor/InputSettings.jsx +++ b/src/Editor/InputSettings.jsx @@ -47,7 +47,6 @@ const StyledTab = styled((props) => )( ); const InputSettings = ({ currentInput }) => { - // console.log(questionName); // issue with selcting the last question on clicking from one question to another. const [updateQuestionName] = useQuestions((state) => { return [state.updateQuestionName]; diff --git a/src/ForgotPassword/ForgotPassword.jsx b/src/ForgotPassword/ForgotPassword.jsx index d5c72f8..d3b452b 100644 --- a/src/ForgotPassword/ForgotPassword.jsx +++ b/src/ForgotPassword/ForgotPassword.jsx @@ -2,40 +2,39 @@ import React from "react"; import { useAuthContext } from "../auth"; import { useNavigate } from "react-router-dom"; - - const ForgotPassword = () => { - const { forgotPassword } = useAuthContext() - const navigate=useNavigate() - const handleForm=async(e)=>{ - e.preventDefault() + const { forgotPassword } = useAuthContext(); + const navigate = useNavigate(); + const handleForm = async (e) => { + e.preventDefault(); try { - const { data, error } = await forgotPassword(e.target.uname.value) - if(!error && data){ - console.log("Password reset has been sent to your email"); + const { data, error } = await forgotPassword(e.target.uname.value); + if (!error && data) { // show toast or something - navigate("/login") + navigate("/login"); } - if(error){ - // form error + if (error) { + // form error } } catch (error) { console.log("there was an unexpected error"); // form error } - } + }; return (
-
-
-

Forgot password ?

- - -
- -
+
+
+

Forgot password ?

+ + +
+ +
- ) + ); }; -export {ForgotPassword}; +export { ForgotPassword }; diff --git a/src/ForgotPassword/NewPassword.jsx b/src/ForgotPassword/NewPassword.jsx index a9f3794..c1f5ec4 100644 --- a/src/ForgotPassword/NewPassword.jsx +++ b/src/ForgotPassword/NewPassword.jsx @@ -4,32 +4,38 @@ import { supabase } from "../_supabase/supabaseInitialize"; import { useNavigate } from "react-router-dom"; const NewPassword = () => { - const { updatePassword } = useAuthContext() - const navigate=useNavigate() - const handleForm=async(e)=>{ - e.preventDefault() - try { - const { data, error } = await updatePassword(e.target.uname.value) - console.log(data); - console.log("Password was updated !!"); - navigate("/dashboard") - } catch (error) { - alert("There was an error updating your password.") - } + const { updatePassword } = useAuthContext(); + const navigate = useNavigate(); + const handleForm = async (e) => { + e.preventDefault(); + try { + const { data, error } = await updatePassword(e.target.uname.value); + // show toast + navigate("/dashboard"); + } catch (error) { + alert("There was an error updating your password."); } - - return ( + }; + + return ( +
+
- -
-

Your new password

- - -
- - +

Your new password

+ +
- ) + + +
+ ); }; export default NewPassword; diff --git a/src/Input/InputCommon.jsx b/src/Input/InputCommon.jsx index fbbec3a..1e4065b 100644 --- a/src/Input/InputCommon.jsx +++ b/src/Input/InputCommon.jsx @@ -43,7 +43,9 @@ const InputCommon = ({ spacing={2} > - {questionName} + + {questionName} + { try { const { data, error } = await signInWithGoogle(); if (!error && data) { - console.log("Google sign in success"); + // show toast } if (error) { - console.log("There was an error"); + // show toast } } catch (error) { setError("There was an unsupported response from server."); @@ -74,10 +74,10 @@ const LoginPage = () => { const handleAnonymous = async () => { try { await signInOutsider(); - console.log("WE ARE MOVING TO DASHBOARD"); + // show toast navigate("/dashboard"); } catch (error) { - console.log("Error occured"); + // show toast } }; const formik = useFormik({ diff --git a/src/SignupPage/SignUpEmail.jsx b/src/SignupPage/SignUpEmail.jsx index fb3bd36..da12932 100644 --- a/src/SignupPage/SignUpEmail.jsx +++ b/src/SignupPage/SignUpEmail.jsx @@ -4,10 +4,8 @@ import * as yup from "yup"; import { Button, InputAdornment, TextField } from "@mui/material"; import { Link, useNavigate } from "react-router-dom"; import { useAuthContext } from "../auth"; -import eyeLineCross from "../../assets/download-eye.svg" -import eyeLine from "../../assets/download-eye-text.svg" - - +import eyeLineCross from "../../assets/download-eye.svg"; +import eyeLine from "../../assets/download-eye-text.svg"; const signupSchema = yup.object({ email: yup @@ -25,27 +23,33 @@ const signupSchema = yup.object({ }); const SignUpEmail = () => { - const [error, setError] = useState("") - const [loading, setLoading] = useState(false) - const [show,setShow]=useState(true) - const { signup, currentUser, setCurrentUser, signUpWithGoogle,signUpWithEmail } = useAuthContext() - const navigate = useNavigate() + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + const [show, setShow] = useState(true); + const { + signup, + currentUser, + setCurrentUser, + signUpWithGoogle, + signUpWithEmail, + } = useAuthContext(); + const navigate = useNavigate(); const handleForm = async (email, password) => { try { - setError("") - setLoading(true) - const { data, error } =await signUpWithEmail(email, password) - if(!error && data) { - console.log("Registration Successful. Check your email to confirm your account"); - navigate("/dashboard") - }else{ - setError("Registration denied,Please see if this email already exist") + setError(""); + setLoading(true); + const { data, error } = await signUpWithEmail(email, password); + if (!error && data) { + // show toast + navigate("/dashboard"); + } else { + setError("Registration denied,Please see if this email already exist"); } } catch (error) { - setError("Registration denied,Please see if this email already exist") + setError("Registration denied,Please see if this email already exist"); } - setLoading(false) - } + setLoading(false); + }; const formik = useFormik({ initialValues: { email: "", @@ -53,15 +57,12 @@ const SignUpEmail = () => { }, validationSchema: signupSchema, onSubmit: (values) => { - console.log(values); - handleForm(values.email, values.password) + handleForm(values.email, values.password); }, }); const HandleFormError = () => { - return ( -

{formik.errors.email}

- ) - } + return

{formik.errors.email}

; + }; const handleErrorBox = () => { return (
@@ -70,11 +71,11 @@ const SignUpEmail = () => {

{error}

- ) - } - const handleHide=()=>{ - setShow(!show) - } + ); + }; + const handleHide = () => { + setShow(!show); + }; return (
@@ -86,7 +87,10 @@ const SignUpEmail = () => {
-

Get better data with conversational forms, surveys, quizzes & more.

+

+ Get better data with conversational forms, surveys, quizzes & + more. +

@@ -106,7 +110,11 @@ const SignUpEmail = () => { placeholder="bruce@wayne.com" variant="outlined" /> - {(formik.touched.email && Boolean(formik.errors.email)) ? HandleFormError() : <>} + {formik.touched.email && Boolean(formik.errors.email) ? ( + HandleFormError() + ) : ( + <> + )}
@@ -117,11 +125,15 @@ const SignUpEmail = () => { endAdornment: ( {show ? ( - + ) : ( )} @@ -132,19 +144,33 @@ const SignUpEmail = () => { className="credential-field-inactive" value={formik.values.password} onChange={formik.handleChange} - type={show ? "text": "password"} + type={show ? "text" : "password"} name="password" placeholder="Atleast 8 characters" variant="outlined" /> - {(formik.touched.password && Boolean(formik.errors.password)) ?

{formik.errors.password}

: <>} + {formik.touched.password && + Boolean(formik.errors.password) ? ( +

+ {formik.errors.password} +

+ ) : ( + <> + )}
-
{/* Forgot Password? */}
- +
@@ -152,7 +178,7 @@ const SignUpEmail = () => {
- ) + ); }; export default SignUpEmail; diff --git a/src/SignupPage/index.jsx b/src/SignupPage/index.jsx index e26fb3e..b69a638 100644 --- a/src/SignupPage/index.jsx +++ b/src/SignupPage/index.jsx @@ -14,10 +14,10 @@ const SignupPage = () => { try { const { data, error } = await signInWithGoogle(); if (!error && data) { - console.log("Google sign in success"); + // show toast } } catch (error) { - console.log("Error occured"); + // show toast } }; diff --git a/src/_components/PrivateRoute/PrivateRoute.jsx b/src/_components/PrivateRoute/PrivateRoute.jsx index 73ba036..e6908bd 100644 --- a/src/_components/PrivateRoute/PrivateRoute.jsx +++ b/src/_components/PrivateRoute/PrivateRoute.jsx @@ -4,30 +4,28 @@ import { useAuthContext } from "../../auth"; import { supabase } from "../../_supabase/supabaseInitialize"; export const PrivateRoute = () => { - const { currentUser,setCurrentUser } = useAuthContext(); - const navigate=useNavigate() + const { currentUser, setCurrentUser } = useAuthContext(); + const navigate = useNavigate(); let user; async function readSession() { - const {data: { session }}=await supabase.auth.getSession() + const { + data: { session }, + } = await supabase.auth.getSession(); // setSession(session) - user=session?.user - - if (user){ - console.log("Private route user here"); - setCurrentUser(user) - }else{ - console.log("No user found"); - navigate("/login") + user = session?.user; + + if (user) { + setCurrentUser(user); + } else { + navigate("/login"); } } useEffect(() => { - if(!currentUser){ - readSession() + if (!currentUser) { + readSession(); } - }, [currentUser]) - - return ( - - ); + }, [currentUser]); + + return ; }; diff --git a/src/_services/CreateFormService.js b/src/_services/CreateFormService.js index a0f9700..0894c3a 100644 --- a/src/_services/CreateFormService.js +++ b/src/_services/CreateFormService.js @@ -1,7 +1,6 @@ import { create } from "zustand"; import { supabase } from "../_supabase/supabaseInitialize"; -import { toast } from 'react-toastify'; - +import { toast } from "react-toastify"; export const useCreateFormStore = create((set, get) => ({ loading: true, @@ -34,15 +33,17 @@ export const useCreateFormStore = create((set, get) => ({ deleteForms: async (form_id) => { set(() => ({ loading: true })); try { - console.log("We are callong") - const {error,status} = await supabase.from("forms").delete().eq("id", form_id); - if(error){ - if(status==0){ + const { error, status } = await supabase + .from("forms") + .delete() + .eq("id", form_id); + if (error) { + if (status == 0) { set(() => ({ error: "You’re offline", loading: false })); - toast("You’re offline") - }else{ + toast("You’re offline"); + } else { set(() => ({ error: error.message, loading: false })); - } + } return; } let currentFetch = get().fetchFormsAgain; diff --git a/src/_styles/editor.scss b/src/_styles/editor.scss index d85c132..5df1ccb 100644 --- a/src/_styles/editor.scss +++ b/src/_styles/editor.scss @@ -289,6 +289,11 @@ cursor: pointer; display: flex; justify-content: space-between; + p { + white-space: wrap; + overflow: hidden; + text-overflow: ellipsis; + } .form-details-dropdown { span { transform: rotate(90deg); diff --git a/src/_ui/ProfileDropdown/ProfileDropdown.jsx b/src/_ui/ProfileDropdown/ProfileDropdown.jsx index 31f5725..f855efa 100644 --- a/src/_ui/ProfileDropdown/ProfileDropdown.jsx +++ b/src/_ui/ProfileDropdown/ProfileDropdown.jsx @@ -33,10 +33,9 @@ export default function ProfileDropdown({ await signOut(); setCurrentUser(); } catch (error) { - console.log("There was an error"); + // show toast } }; - console.log(userDetails); return ( <> diff --git a/src/auth/Authorize.jsx b/src/auth/Authorize.jsx index 6e38d70..bffa806 100644 --- a/src/auth/Authorize.jsx +++ b/src/auth/Authorize.jsx @@ -51,8 +51,6 @@ const Authorize = ({ children }) => { } = supabase.auth.onAuthStateChange((_event, session) => { if (_event === "SIGNED_IN") { if (currentUser === undefined) { - console.log(_event); - setCurrentUser(session.user); setSession(session); } @@ -68,7 +66,6 @@ const Authorize = ({ children }) => { if (!session) { console.log("No supabase user"); } else { - console.log(session, "SESSION"); console.log("Supabase user exist"); } const value = {