mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-10 06:10:17 -04:00
debug disabled prop
This commit is contained in:
parent
7da992c8ab
commit
c510c59057
|
@ -19,7 +19,10 @@ export default function Page() {
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsButtonDisabled(newPassword === '' || confirmPassword === '');
|
console.log('newPassword',newPassword)
|
||||||
|
console.log('confirmPassword',confirmPassword)
|
||||||
|
setIsButtonDisabled(newPassword === '' || confirmPassword === '' || newPassword !== confirmPassword);
|
||||||
|
console.log('newPasswordDisabledTest',isButtonDisabled)
|
||||||
}, [newPassword, confirmPassword]);
|
}, [newPassword, confirmPassword]);
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import React, { FunctionComponent, InputHTMLAttributes, ReactNode } from 'react';
|
import React, { FunctionComponent, InputHTMLAttributes, ReactNode, ChangeEvent } from 'react';
|
||||||
|
|
||||||
type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
title?: ReactNode;
|
title?: ReactNode;
|
||||||
type?:ReactNode;
|
type?:ReactNode;
|
||||||
placeholder?: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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
|
@ -20,6 +21,7 @@ const Input: FunctionComponent<InputProps> = ({ icon, type, title, placeholder,
|
||||||
type={type}
|
type={type}
|
||||||
id={title}
|
id={title}
|
||||||
placeholder={placeholder}
|
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"
|
className="mt-1 w-full border-none p-0 focus:border-transparent focus:outline-none focus:ring-0 sm:text-sm"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user