diff --git a/src/components/Pages/Modals/MedicineEdit.tsx b/src/components/Pages/Modals/MedicineEdit.tsx index cfba88b4..dabb28ef 100644 --- a/src/components/Pages/Modals/MedicineEdit.tsx +++ b/src/components/Pages/Modals/MedicineEdit.tsx @@ -114,6 +114,7 @@ const MedicineEdit = (props: IProps): JSX.Element | null => { const drugTitleType = drugInfo.Id ? 'Edit ' : 'Add ' as string; const drugName = drugInfo.Id ? drugInfo.Drug : 'new drug'; const fullName = activeResident && clientFullName(activeResident); + const modalTitle = otc ? ( @@ -126,15 +127,34 @@ const MedicineEdit = (props: IProps): JSX.Element | null => { ); + const otcAlert = otc && drugInfo.Id !== null ? + ( + + + OTC Warning + + + + + + CAUTION: + Changes to this OTC medicine will affect ALL clients! + + + + ) : ( + <> + ); + return ( { - if (textInput && textInput.current) { - textInput.current.focus() - } - }} + onEntered={() => textInput?.current?.focus()} show={show} size="lg" > @@ -144,27 +164,7 @@ const MedicineEdit = (props: IProps): JSX.Element | null => {
- {otc && drugInfo?.Id && - ( - - - OTC Warning - - - - - - CAUTION: - Changes to this OTC medicine will affect ALL residents! - - - - ) - } + {otcAlert}