Skip to content

Commit 92eb6a6

Browse files
committed
wip
1 parent de2b631 commit 92eb6a6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/ehr/src/components/dialogs/SendInvoiceToPatientDialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ export default function SendInvoiceToPatientDialog({
9393

9494
useEffect(() => {
9595
if (invoiceTask) {
96-
console.log(invoiceTask.id);
97-
setDisableAllFields(false);
9896
const invoiceTaskInput = parseInvoiceTaskInput(invoiceTask);
9997
if (invoiceTaskInput) {
10098
const { dueDate, memo, smsTextMessage, amountCents } = invoiceTaskInput;
@@ -104,6 +102,7 @@ export default function SendInvoiceToPatientDialog({
104102
memo: memo,
105103
smsTextMessage: smsTextMessage,
106104
});
105+
setDisableAllFields(false);
107106
}
108107
}
109108
}, [invoiceTask, reset]);
@@ -178,6 +177,7 @@ export default function SendInvoiceToPatientDialog({
178177
error={!!errors.amount}
179178
helperText={errors.amount?.message}
180179
required
180+
disabled={disableAllFields}
181181
/>
182182
)}
183183
/>
@@ -192,6 +192,7 @@ export default function SendInvoiceToPatientDialog({
192192
rules={{ required: REQUIRED_FIELD_ERROR_MESSAGE }}
193193
component="Picker"
194194
disabled={disableAllFields}
195+
disablePast={true}
195196
/>
196197
</Grid>
197198

apps/ehr/src/components/form/DatePicker.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface BasicDatePickerProps {
2121
id?: string;
2222
dataTestId?: string;
2323
component?: 'Picker' | 'Field';
24+
disablePast?: boolean;
2425
}
2526

2627
export function BasicDatePicker({
@@ -36,6 +37,7 @@ export function BasicDatePicker({
3637
id,
3738
dataTestId,
3839
component = 'Picker',
40+
disablePast = false,
3941
}: BasicDatePickerProps): JSX.Element {
4042
return (
4143
<LocalizationProvider dateAdapter={AdapterDayjs}>
@@ -82,6 +84,7 @@ export function BasicDatePicker({
8284
},
8385
}}
8486
label={label}
87+
disablePast={disablePast}
8588
/>
8689
);
8790
} else {
@@ -108,6 +111,7 @@ export function BasicDatePicker({
108111
InputLabelProps,
109112
},
110113
}}
114+
disablePast={disablePast}
111115
/>
112116
);
113117
}

0 commit comments

Comments
 (0)