debug disabled prop

This commit is contained in:
Advik Arora 2024-02-27 14:53:03 -05:00
parent 7da992c8ab
commit c510c59057
2 changed files with 8 additions and 3 deletions

View File

@ -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]);

View File

@ -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>