Skip to content

Commit e63d703

Browse files
authored
fix: wrong unit name when using lbs (#512)
1 parent fda02d7 commit e63d703

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/instruments/src/EFB/apps/Aircraft/FuelPayload.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export const FuelPayload: FC = () => {
9191
plannedFuel && setFuel(metric ? plannedFuel * 2.205 : plannedFuel);
9292
};
9393

94+
const unitString = metric ? "kg" : "lbs";
95+
9496
return (
9597
<Container>
9698
<ChartWidgetContainer>
@@ -114,8 +116,8 @@ export const FuelPayload: FC = () => {
114116
<Label>Actual</Label>
115117
<ItemGroup style={itemGroupStyle} spacing={0}>
116118
<InfoColumn label="Pax" value={`${Math.round(pax)}/363`} />
117-
<InfoColumn label="Cargo" value={`${metric ? Math.round(cargo / 2.205) : cargo} kg`} />
118-
<InfoColumn label="ZFW" value={`${metric ? Math.round(zfw / 2.205) : zfw} kg`} />
119+
<InfoColumn label="Cargo" value={`${metric ? Math.round(cargo / 2.205) : cargo} ${unitString}`} />
120+
<InfoColumn label="ZFW" value={`${metric ? Math.round(zfw / 2.205) : zfw} ${unitString}`} />
119121
<InfoColumn label="CG" value={`${cg.toFixed(2)}%`} />
120122
</ItemGroup>
121123
</ItemGroupContainer>
@@ -125,14 +127,14 @@ export const FuelPayload: FC = () => {
125127
<InputColumn label="Pax" placeholder="0/363" value={plannedPax} setter={setPlannedPax} filterFn={paxInputFilter} />
126128
<InputColumn
127129
label="Cargo"
128-
placeholder={`0 ${metric ? "kg" : "lbs"}`}
130+
placeholder={`0 ${unitString}`}
129131
value={plannedCargo}
130132
setter={setPlannedCargo}
131133
filterFn={weightInputFilter}
132134
/>
133135
<InputColumn
134136
label="ZFW"
135-
placeholder={`0 ${metric ? "kg" : "lbs"}`}
137+
placeholder={`0 ${unitString}`}
136138
value={plannedZfw}
137139
setter={setPlannedZfw}
138140
filterFn={weightInputFilter}
@@ -144,14 +146,14 @@ export const FuelPayload: FC = () => {
144146
<WeightInputContainer>
145147
<ItemGroupContainer>
146148
<ItemGroup style={itemGroupStyle} spacing={0}>
147-
<InfoColumn label="Fuel" value={`${metric ? Math.round(fuel / 2.205) : fuel} ${metric ? "kg" : "lbs"}`} />
149+
<InfoColumn label="Fuel" value={`${metric ? Math.round(fuel / 2.205) : fuel} ${unitString}`} />
148150
</ItemGroup>
149151
</ItemGroupContainer>
150152
<ItemGroupContainer>
151153
<ItemGroup style={itemGroupStyle} spacing={0}>
152154
<InputColumn
153155
label="Fuel"
154-
placeholder={`0 ${metric ? "kg" : "lbs"}`}
156+
placeholder={`0 ${unitString}`}
155157
value={plannedFuel}
156158
setter={setPlannedFuel}
157159
filterFn={weightInputFilter}

0 commit comments

Comments
 (0)