From c510c590576460a1e2bb53355f0d6aa70b9d49af Mon Sep 17 00:00:00 2001 From: Advik Arora <aroraadvik@gmail.com> Date: Tue, 27 Feb 2024 14:53:03 -0500 Subject: [PATCH] debug disabled prop --- compass/app/auth/{new_Password => newPassword}/page.tsx | 5 ++++- compass/components/Input.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) rename compass/app/auth/{new_Password => newPassword}/page.tsx (91%) diff --git a/compass/app/auth/new_Password/page.tsx b/compass/app/auth/newPassword/page.tsx similarity index 91% rename from compass/app/auth/new_Password/page.tsx rename to compass/app/auth/newPassword/page.tsx index 0ccee79..a49f566 100644 --- a/compass/app/auth/new_Password/page.tsx +++ b/compass/app/auth/newPassword/page.tsx @@ -19,7 +19,10 @@ export default function Page() { useEffect(() => { - setIsButtonDisabled(newPassword === '' || confirmPassword === ''); + console.log('newPassword',newPassword) + console.log('confirmPassword',confirmPassword) + setIsButtonDisabled(newPassword === '' || confirmPassword === '' || newPassword !== confirmPassword); + console.log('newPasswordDisabledTest',isButtonDisabled) }, [newPassword, confirmPassword]); diff --git a/compass/components/Input.tsx b/compass/components/Input.tsx index 618295b..d5a4348 100644 --- a/compass/components/Input.tsx +++ b/compass/components/Input.tsx @@ -1,13 +1,14 @@ -import React, { FunctionComponent, InputHTMLAttributes, ReactNode } from 'react'; +import React, { FunctionComponent, InputHTMLAttributes, ReactNode, ChangeEvent } from 'react'; type InputProps = InputHTMLAttributes<HTMLInputElement> & { icon?: ReactNode; title?: ReactNode; type?:ReactNode; placeholder?:ReactNode + onChange: (event: ChangeEvent<HTMLInputElement>) => void; }; -const Input: FunctionComponent<InputProps> = ({ icon, type, title, placeholder, ...rest }) => { +const Input: FunctionComponent<InputProps> = ({ icon, type, title, placeholder, onChange, ...rest }) => { return ( <div> <label @@ -20,6 +21,7 @@ const Input: FunctionComponent<InputProps> = ({ icon, type, title, placeholder, type={type} id={title} placeholder={placeholder} + onChange={onChange} className="mt-1 w-full border-none p-0 focus:border-transparent focus:outline-none focus:ring-0 sm:text-sm" /> </label>