-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
249 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
'use client' | ||
"use client"; | ||
import { FormEvent } from "react"; | ||
import OtpVerificationModel from "@/components/models/OtpVerificationModel"; | ||
|
||
const OptInterceptor = () =>{ | ||
const handleVerify = (e:FormEvent)=>{ | ||
e.preventDefault(); | ||
}; | ||
const handleResend = ()=>{} | ||
return ( | ||
<OtpVerificationModel returnRoute="/signin" key={12} timer={30} handleResend={handleResend} handleVerify={handleVerify} /> | ||
); | ||
} | ||
const OptInterceptor = () => { | ||
const handleVerify = (e: FormEvent) => { | ||
e.preventDefault(); | ||
}; | ||
const handleResend = () => {}; | ||
return ( | ||
<OtpVerificationModel | ||
returnRoute="/signin" | ||
key={12} | ||
timer={30} | ||
handleResend={handleResend} | ||
handleVerify={handleVerify} | ||
/> | ||
); | ||
}; | ||
|
||
export default OptInterceptor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react' | ||
import SigninForm from "../../../../components/common/forms/SigninForm"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { Banners } from "../../../../constants"; | ||
|
||
const FromSection = () => { | ||
|
||
return ( | ||
<div className="flex h-screen max-h-screen"> | ||
<section className="remove-scrollbar container my-auto"> | ||
<div className="sub-container max-[496px]"> | ||
<Image | ||
src={"/assets/icons/logo-full.svg"} | ||
width={1000} | ||
height={1000} | ||
alt="patient" | ||
className="mb-12 h-10 w-fit" | ||
/> | ||
<SigninForm /> | ||
<div className="text-14-regular py-12 flex justify-between"> | ||
<p className="justify-items-end text-dark-600 xl:text-left">© 2024 AVM Ayurveda's</p> | ||
<Link href={"/signup"} className="text-green-500 text-xs"> | ||
Staff-Login | ||
</Link> | ||
</div> | ||
</div> | ||
</section> | ||
<Image src={Banners.signin} height={1000} width={1000} alt="patient" className="side-img max-w-[50%]" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FromSection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
"use client"; | ||
import OtpVerificationSection from "@/components/common/forms/OtpForms"; | ||
import Image from "next/image"; | ||
import React, { FormEvent, useState } from "react"; | ||
import { useValidateOtpPatient } from "@/lib/hooks/usePatinet"; | ||
import { FormEvent, useState } from "react"; | ||
import { useValidateOtpPatient } from "@/lib/hooks/usePatientAuth"; | ||
import { useToast } from "@/components/ui/use-toast"; | ||
import { useRouter } from "next/navigation"; | ||
import { Button } from "@/components/ui/button"; | ||
import Link from "next/link"; | ||
import { Banners } from "@/constants"; | ||
import { useDispatch } from "react-redux"; | ||
|
||
const OtpVerificationPage = () => { | ||
const [otp, setOtp] = useState<string>(""); | ||
const { mutate: validateOtp, isPending } = useValidateOtpPatient(); | ||
const { toast } = useToast(); | ||
const navigate = useRouter(); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
const handleVerify = async (e: FormEvent) => { | ||
e.preventDefault(); | ||
validateOtp( | ||
{ email: "[email protected]", otp: parseInt(otp) }, | ||
{ | ||
onSuccess: (data) => { | ||
onSuccess: () => { | ||
toast({ | ||
title: "Otp Verification Success ✅", | ||
description: "Authentication Completed!. let's book your first appointment", | ||
|
@@ -31,7 +33,7 @@ const OtpVerificationPage = () => { | |
</Button> | ||
), | ||
}); | ||
console.log(data); | ||
navigate.push("/"); | ||
}, | ||
onError: (error) => { | ||
toast({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ErrorResponse, IPatient } from "@/types"; | ||
import { useMutation } from "@tanstack/react-query"; | ||
import { signInPatient, signUpPatient, validateOtpPatient } from "@/services/api/auth/patientAuth"; | ||
import { AxiosError } from "axios"; | ||
|
||
export const useSignUpPatient = () => { | ||
return useMutation<{ message: string }, AxiosError<ErrorResponse>, IPatient>({ | ||
mutationFn: (patient) => signUpPatient(patient), | ||
onError: (error: AxiosError) => { | ||
console.log("Error in creating patient:", error); | ||
}, | ||
}); | ||
}; | ||
|
||
export const useSignInPatient = () => { | ||
return useMutation< | ||
{ message: string; email: string }, | ||
AxiosError<ErrorResponse>, | ||
{ email: string; password: string } | ||
>({ | ||
mutationFn: ({ email, password }) => signInPatient(email, password), | ||
onError: (error) => { | ||
console.log("Error in signing in:", error); | ||
}, | ||
}); | ||
}; | ||
|
||
export const useValidateOtpPatient = () => { | ||
return useMutation<{ accessToken: string }, AxiosError<ErrorResponse>, { email: string; otp: number }>({ | ||
mutationFn: ({ email, otp }) => validateOtpPatient(email, otp), | ||
onError: (error) => { | ||
console.log("Error in OTP validation:", error); | ||
}, | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
7083a09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
avm-care – ./
avm-care.vercel.app
avm-care-git-main-sinans-projects-8d312afe.vercel.app
avm-care-sinans-projects-8d312afe.vercel.app