From de83facf5a78656ee49d56cb0ce3a23b516e9d9c Mon Sep 17 00:00:00 2001 From: Sinan Date: Tue, 27 Aug 2024 20:30:15 +0530 Subject: [PATCH] =?UTF-8?q?Redux=20removed:=20=EF=BF=BD=E2=9C=94=20working?= =?UTF-8?q?=20fine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signin/otp-verification/page.tsx | 14 +-- client/app/StoreProvider.tsx | 13 --- client/app/layout.tsx | 3 - .../staff/@signin/otp-verification/page.tsx | 10 +- client/app/staff/@signin/page.tsx | 1 - client/components/forms/OtpForms.tsx | 73 +++++++------- client/components/forms/RegistrationForm.tsx | 28 +----- client/components/forms/SigninForm.tsx | 16 +--- client/components/forms/SignupForm.tsx | 7 +- client/components/utils/SearchInput.tsx | 29 ------ client/lib/features/api/authApi.ts | 43 --------- client/lib/features/slices/authSlice.ts | 29 ------ .../lib/middlewares/localStorageMiddleware.ts | 14 --- client/lib/store.ts | 22 ----- client/lib/utils.ts | 77 --------------- client/package-lock.json | 96 ------------------- client/package.json | 3 - client/types/auth.ts | 7 -- client/types/index.ts | 6 -- 19 files changed, 46 insertions(+), 445 deletions(-) delete mode 100644 client/app/StoreProvider.tsx delete mode 100644 client/components/utils/SearchInput.tsx delete mode 100644 client/lib/features/api/authApi.ts delete mode 100644 client/lib/features/slices/authSlice.ts delete mode 100644 client/lib/middlewares/localStorageMiddleware.ts delete mode 100644 client/lib/store.ts delete mode 100644 client/types/auth.ts diff --git a/client/app/(patient)/signin/otp-verification/page.tsx b/client/app/(patient)/signin/otp-verification/page.tsx index e54abd09..315dfe39 100644 --- a/client/app/(patient)/signin/otp-verification/page.tsx +++ b/client/app/(patient)/signin/otp-verification/page.tsx @@ -1,25 +1,16 @@ "use client"; import OtpVerificationSection from "@/components/forms/OtpForms"; -import { useVerifyOtpMutation } from "@/lib/features/api/authApi"; import Image from "next/image"; import React, { FormEvent, useState } from "react"; -import { useSelector } from "react-redux"; -import {RootState} from '@/lib/store' - const OtpVerificationPage = () => { - const [otp,setOtp] = useState('') - const [verifyOtp, { isLoading , data}] = useVerifyOtpMutation(); - const email = useSelector((state:RootState)=>state.auth.token) as string + const [otp, setOtp] = useState(""); + const [isLoading, setLoading] = useState(false); const handleVerify = async (e: FormEvent) => { e.preventDefault(); try { - await verifyOtp({otp: parseInt(otp),email}); - console.log(data); - } catch (error) { console.log(error); - } }; @@ -44,7 +35,6 @@ const OtpVerificationPage = () => { isLoading={isLoading} timer={30} /> - diff --git a/client/app/StoreProvider.tsx b/client/app/StoreProvider.tsx deleted file mode 100644 index 05fbb9bd..00000000 --- a/client/app/StoreProvider.tsx +++ /dev/null @@ -1,13 +0,0 @@ -"use client"; - -import { Provider } from "react-redux"; -import { makeStore, AppStore } from "@/lib/store"; -import { useRef } from "react"; - -export const StoreProvider = ({ children }: { children: React.ReactNode }) => { - const storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = makeStore(); - } - return {children}; -}; diff --git a/client/app/layout.tsx b/client/app/layout.tsx index 24d8af14..798b60fb 100644 --- a/client/app/layout.tsx +++ b/client/app/layout.tsx @@ -3,7 +3,6 @@ import { Plus_Jakarta_Sans } from "next/font/google"; import "../styles/globals.css"; import { cn } from "@/lib/utils"; import { ThemeProvider } from "@/components/ThemeProvider"; -import { StoreProvider } from "./StoreProvider"; import NavBar from "@/components/NavBar"; import Footer from "@/components/Footer"; import { Toaster } from "@/components/ui/toaster"; @@ -31,14 +30,12 @@ export default function RootLayout({ return ( - {children}