Skip to content

Commit

Permalink
(fix) UI fixes for vitals and biometrics form fields (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Jun 28, 2024
1 parent b917f2f commit beba218
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}

.tablet {
margin: 0.5rem 0;
padding: 1.5rem 1rem;
background-color: $ui-02;
}
Expand Down Expand Up @@ -56,7 +57,7 @@
margin: 0.5rem 0rem 0rem;
display: flex;
flex-flow: row wrap;
gap: 1rem;
gap: 1rem 0.75rem;
}

.spacer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ type fieldId =
type AbnormalValue = 'critically_low' | 'critically_high' | 'high' | 'low';
type FieldTypes = 'number' | 'textarea';

interface ResponsiveWrapperProps {
children: React.ReactNode;
isTablet: boolean;
}

interface VitalsAndBiometricsInputProps {
control: Control<VitalsBiometricsFormData>;
fieldStyles?: React.CSSProperties;
Expand Down Expand Up @@ -77,7 +72,6 @@ const VitalsAndBiometricsInput: React.FC<VitalsAndBiometricsInputProps> = ({
const [isFocused, setIsFocused] = useState(false);

const abnormalValues: Array<AbnormalValue> = ['critically_low', 'critically_high', 'high', 'low'];

const hasAbnormalValue = !isFocused && interpretation && abnormalValues.includes(interpretation as AbnormalValue);

function checkValidity(value, onChange) {
Expand Down Expand Up @@ -126,7 +120,11 @@ const VitalsAndBiometricsInput: React.FC<VitalsAndBiometricsInputProps> = ({
) : null}
</section>
<section className={inputClasses} style={{ ...fieldStyles }}>
<div className={styles.centered}>
<div
className={classNames({
[styles.centered]: !isTablet || unitSymbol === 'mmHg',
})}
>
{fieldProperties.map((fieldProperty) => {
if (fieldProperty.type === 'number') {
const numberInputClasses = classNames(styles.numberInput, fieldProperty.className);
Expand Down

0 comments on commit beba218

Please sign in to comment.