From 3adfbceb0994971b7c7d9399c557e25cbddc8504 Mon Sep 17 00:00:00 2001 From: Omkar76 Date: Wed, 6 Dec 2023 23:53:05 +0530 Subject: [PATCH] Replace checkbox by button --- src/Components/Patient/DailyRounds.tsx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 3477f3203cb..41449e7c22d 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -26,9 +26,8 @@ import BloodPressureFormField, { } from "../Common/BloodPressureFormField"; import { SymptomsSelect } from "../Common/SymptomsSelect"; import TemperatureFormField from "../Common/TemperatureFormField"; -import { Cancel, Submit } from "../Common/components/ButtonV2"; +import ButtonV2, { Cancel, Submit } from "../Common/components/ButtonV2"; import Page from "../Common/components/Page"; -import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import RangeAutocompleteFormField from "../Form/FormFields/RangeAutocompleteFormField"; import { SelectFormField } from "../Form/FormFields/SelectFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; @@ -192,7 +191,7 @@ export const DailyRounds = (props: any) => { RHYTHM_CHOICES.find((i) => i.text === res.data.rhythm)?.id) || "0", temperature: parseFloat(res.data.temperature), - clone_last: res.data.count > 0 ? true : false, + clone_last: false, }, }); } @@ -451,17 +450,25 @@ export const DailyRounds = (props: any) => { {!id && hasPreviousLog && ( - + { + e.preventDefault(); + dispatch({ + type: "set_form", + form: { ...state.form, clone_last: true }, + }); + }} + > + Copy values from previous log + )} - {state.form.clone_last === true && ( + {state.form.clone_last && (

Field values will be copied from previous log update

)} - {(state.form.clone_last === false || id) && ( + {!state.form.clone_last && (