Cleanup old configs
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { FC } from 'react';
|
||||
import { SharedConfig } from '../../configs/shared';
|
||||
|
||||
interface CGSelectProps {
|
||||
minCG: number;
|
||||
maxCG: number;
|
||||
value: number;
|
||||
disabled: boolean;
|
||||
increase: () => void;
|
||||
decrease: () => void;
|
||||
}
|
||||
|
||||
const CGSelect: FC<CGSelectProps> = ({ value, disabled, increase, decrease }) => {
|
||||
const CGSelect: FC<CGSelectProps> = ({ minCG, maxCG, value, disabled, increase, decrease }) => {
|
||||
return (
|
||||
<div className="relative">
|
||||
<input
|
||||
@@ -17,7 +18,7 @@ const CGSelect: FC<CGSelectProps> = ({ value, disabled, increase, decrease }) =>
|
||||
value={value.toFixed(1)}
|
||||
/>
|
||||
<button
|
||||
disabled={disabled || value <= SharedConfig.CGLimits.min}
|
||||
disabled={disabled || value <= minCG}
|
||||
className="absolute right-2 top-0 -mt-[.5px] border-t bg-zinc-700 text-white disabled:text-zinc-400"
|
||||
onClick={increase}
|
||||
>
|
||||
@@ -45,7 +46,7 @@ const CGSelect: FC<CGSelectProps> = ({ value, disabled, increase, decrease }) =>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
disabled={disabled || value >= SharedConfig.CGLimits.max}
|
||||
disabled={disabled || value >= maxCG}
|
||||
className="absolute bottom-0 right-2 -mt-[.5px] border-b bg-zinc-700 text-white disabled:text-zinc-400"
|
||||
onClick={decrease}
|
||||
>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { emptyAircraft, SharedConfig } from '../../configs/shared';
|
||||
import { emptyAircraft } from '../../configs/shared';
|
||||
import { COHERENT_COMBUS_WASM_CALL, COMM_BUS_UPDATE_TARGET_EVENT } from '../../constants';
|
||||
import { WASMDataPax } from '../../types/WASMData';
|
||||
import CGSelect from '../CGSelect/CGSelect';
|
||||
@@ -112,9 +112,11 @@ const ZFWEntryPax: FC<StationEntryProps> = ({ WASMData, loadingState, setLoading
|
||||
</div>
|
||||
<div className="relative flex w-full items-center justify-between rounded-b-md bg-zinc-700 p-2 px-4">
|
||||
<label>
|
||||
Target ZFWCG ({SharedConfig.CGLimits.min} - {SharedConfig.CGLimits.max})
|
||||
Target ZFWCG ({WASMData.limits.minCG} - {WASMData.limits.maxCG})
|
||||
</label>
|
||||
<CGSelect
|
||||
minCG={WASMData.limits.minCG}
|
||||
maxCG={WASMData.limits.maxCG}
|
||||
value={targetZFWCG}
|
||||
disabled={loadingState !== 'preview'}
|
||||
increase={() =>
|
||||
|
||||
Reference in New Issue
Block a user