Browse Source

Rename some vars

reconnect-to-maker
bonomat 3 years ago
parent
commit
ed14856da3
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 6
      taker-frontend/src/App.tsx
  2. 16
      taker-frontend/src/components/Trade.tsx

6
taker-frontend/src/App.tsx

@ -149,10 +149,10 @@ export const App = () => {
<Route path="/"> <Route path="/">
<VStack divider={<StackDivider borderColor="gray.500" />} spacing={4}> <VStack divider={<StackDivider borderColor="gray.500" />} spacing={4}>
<Trade <Trade
order_id={order?.id} orderId={order?.id}
quantity={format(effectiveQuantity)} quantity={format(effectiveQuantity)}
max_quantity={max_quantity || 0} maxQuantity={max_quantity || 0}
min_quantity={min_quantity || 0} minQuantity={min_quantity || 0}
referencePrice={referencePrice} referencePrice={referencePrice}
askPrice={askPrice} askPrice={askPrice}
margin={margin} margin={margin}

16
taker-frontend/src/components/Trade.tsx

@ -47,9 +47,9 @@ import { CfdOrderRequestPayload } from "./Types";
const MotionBox = motion<BoxProps>(Box); const MotionBox = motion<BoxProps>(Box);
interface TradeProps { interface TradeProps {
order_id?: string; orderId?: string;
min_quantity: number; minQuantity: number;
max_quantity: number; maxQuantity: number;
referencePrice?: number; referencePrice?: number;
askPrice?: number; askPrice?: number;
margin?: string; margin?: string;
@ -64,8 +64,8 @@ interface TradeProps {
const Trade = ( const Trade = (
{ {
min_quantity, minQuantity,
max_quantity, maxQuantity,
referencePrice: referencePriceAsNumber, referencePrice: referencePriceAsNumber,
askPrice: askPriceAsNumber, askPrice: askPriceAsNumber,
quantity, quantity,
@ -75,7 +75,7 @@ const Trade = (
liquidationPrice: liquidationPriceAsNumber, liquidationPrice: liquidationPriceAsNumber,
canSubmit, canSubmit,
onLongSubmit, onLongSubmit,
order_id, orderId,
}: TradeProps, }: TradeProps,
) => { ) => {
let outerCircleBg = useColorModeValue("gray.100", "gray.700"); let outerCircleBg = useColorModeValue("gray.100", "gray.700");
@ -93,7 +93,7 @@ const Trade = (
const quantityAsNumber = quantity.replace("$", ""); const quantityAsNumber = quantity.replace("$", "");
let payload: CfdOrderRequestPayload = { let payload: CfdOrderRequestPayload = {
order_id: order_id!, order_id: orderId!,
quantity: Number.parseFloat(quantityAsNumber), quantity: Number.parseFloat(quantityAsNumber),
}; };
await onLongSubmit(payload); await onLongSubmit(payload);
@ -138,7 +138,7 @@ const Trade = (
</Center> </Center>
</GridItem> </GridItem>
<GridItem colSpan={1}> <GridItem colSpan={1}>
<Quantity min={min_quantity} max={max_quantity} quantity={quantity} onChange={onQuantityChange} /> <Quantity min={minQuantity} max={maxQuantity} quantity={quantity} onChange={onQuantityChange} />
</GridItem> </GridItem>
<GridItem colSpan={1}> <GridItem colSpan={1}>
<Leverage leverage={leverage} /> <Leverage leverage={leverage} />

Loading…
Cancel
Save