found issues with the submit button not refreshing state as well as a need for user feedback

This commit is contained in:
StefanWout 2024-11-20 15:20:01 +00:00
parent 7f9b7f2992
commit e8e68e6505

View file

@ -63,6 +63,8 @@ const goalValueOptions = [
},
];
export function SelectDropdown({
options,
selectedOption,
@ -151,19 +153,19 @@ export default function RemoteAssesmentModal({
setValuation(event.target.value);
}
function handleButtonDisabled(): boolean {
return !(
scenario &&
selectedGoal &&
housingType &&
addressLineOne &&
postcode &&
uprn &&
valuation
);
}
useEffect(() => {
function handleButtonDisabled(): boolean {
return !(
scenario &&
selectedGoal &&
housingType &&
addressLineOne &&
postcode &&
uprn &&
valuation
);
}
setButtonDisabled(handleButtonDisabled());
}, [scenario, selectedGoal, housingType, addressLineOne, postcode, uprn, valuation]);
@ -255,7 +257,7 @@ export default function RemoteAssesmentModal({
)}
</div>
<div className="flex justify-center mt-6">
Address Line One
Address Line 1
<Input type="text" onChange={handleAddressLineOneChange}/>
</div>
<div className="flex justify-center mt-6">
@ -286,6 +288,7 @@ export default function RemoteAssesmentModal({
type="button"
className="inline-flex justify-center rounded-md border border-transparent bg-blue-100 px-4 py-2 text-sm font-medium text-blue-900 hover:bg-blue-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"
onClick={() => setIsOpen(false)}
>
Cancel
</button>