Skip to content

Commit

Permalink
chore: spec work on adjustable calculated value widget
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Jun 12, 2023
1 parent 5561847 commit f594363
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions app/lib/theme/widgets/ReadOnlyAdjustableCalculatedValueWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ const ReadOnlyAdjustableCalculatedValueWidget: React.FC<WidgetProps> = (
const adjustedInputId = `${id}_adjusted`;

return (
<div>
<>
{calculatedValue && (
<>
{
<div className={calculatedValue && "calculatedValue"}>
<dt>{label}</dt>
<dd>
<NumberFormat
thousandSeparator
fixedDecimalScale={numberOfDecimalPlaces}
Expand All @@ -35,12 +36,12 @@ const ReadOnlyAdjustableCalculatedValueWidget: React.FC<WidgetProps> = (
value={calculatedValue}
displayType="text"
/>
}
</>
</dd>
</div>
)}
{value !== calculatedValue && (
<div className={calculatedValue && "adjustedValue"}>
{calculatedValue && <dt>{label} (Adjusted)</dt>}
<dt>{label} (Adjusted)</dt>
<dd>
<NumberFormat
thousandSeparator
Expand All @@ -57,17 +58,14 @@ const ReadOnlyAdjustableCalculatedValueWidget: React.FC<WidgetProps> = (
)}
{!value && <em>Not added</em>}
<style jsx>{`
div.adjustedValue {
position: relative;
display: flex;
right: 12.1rem;
margin-top: 0.5em;
div {
display: inline;
}
dt {
margin-right: 1em;
}
`}</style>
</div>
</>
);
};

Expand Down

0 comments on commit f594363

Please sign in to comment.