diff --git a/src/app/components/order_input/AmountInput.tsx b/src/app/components/order_input/AmountInput.tsx index 962eb70a..bacba43a 100644 --- a/src/app/components/order_input/AmountInput.tsx +++ b/src/app/components/order_input/AmountInput.tsx @@ -1,7 +1,12 @@ import React from "react"; import { useAppDispatch, useAppSelector } from "hooks"; -import { OrderSide, TokenInput, orderInputSlice } from "redux/orderInputSlice"; +import { + OrderSide, + TokenInput, + orderInputSlice, + selectTargetToken, +} from "redux/orderInputSlice"; interface TokenInputFiledProps extends TokenInput { onFocus: () => void; @@ -19,7 +24,9 @@ function nullableNumberInput(event: React.ChangeEvent) { } function TokenInputFiled(props: TokenInputFiledProps) { + const targetToken = useAppSelector(selectTargetToken); const { + address, symbol, iconUrl, valid, @@ -30,7 +37,7 @@ function TokenInputFiled(props: TokenInputFiledProps) { onFocus, } = props; return ( -
+
{/* balance */}
Current balance: @@ -40,12 +47,20 @@ function TokenInputFiled(props: TokenInputFiledProps) { {/* input */}
- {symbol} - {symbol} +
+ {symbol} + {symbol} +
+ { dispatch(orderInputSlice.actions.swapTokens()); diff --git a/src/app/components/order_input/LimitOrderInput.tsx b/src/app/components/order_input/LimitOrderInput.tsx index b14a3e3f..88dd1eb0 100644 --- a/src/app/components/order_input/LimitOrderInput.tsx +++ b/src/app/components/order_input/LimitOrderInput.tsx @@ -27,9 +27,6 @@ export function LimitOrderInput() { <>
-

- {side === OrderSide.BUY ? "Buy" : "Sell"} Price -

@@ -40,7 +37,7 @@ export function LimitOrderInput() { ) } > - Best Price:{" "} + Best {side} Price:{" "} state.orderInput.transactionResult ); - const validationResult = useAppSelector(validateOrderInput); + const transactionValidation = useAppSelector(isValidTransaction); const dispatch = useAppDispatch(); const submitString = tab.toString() + " " + side.toString() + " " + symbol; @@ -35,18 +36,14 @@ function SubmitButton() { - dispatch( - orderInputSlice.actions.togglePreventImmediateExecution() - ) - } + onClick={() => dispatch(orderInputSlice.actions.togglePostOnly())} /> - Prevent immediate execution + Post only

)}