diff --git a/src/app/containers/SwapTradeForm/index.tsx b/src/app/containers/SwapTradeForm/index.tsx index aeff714f9..388532e02 100644 --- a/src/app/containers/SwapTradeForm/index.tsx +++ b/src/app/containers/SwapTradeForm/index.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; -import { Icon } from '@blueprintjs/core'; +import { Icon, Tooltip } from '@blueprintjs/core'; import { FieldGroup } from '../../components/FieldGroup'; import { FormSelect } from '../../components/FormSelect'; import { AmountField } from '../AmountField'; @@ -48,8 +48,8 @@ export function SwapTradeForm() { const isConnected = useCanInteract(); const [amount, setAmount] = useState(''); - const [sourceToken, setSourceToken] = useState(Asset.DOC); - const [targetToken, setTargetToken] = useState(Asset.BTC); + const [sourceToken, setSourceToken] = useState(Asset.BTC); + const [targetToken, setTargetToken] = useState(Asset.DOC); const [sourceOptions, setSourceOptions] = useState([]); const [targetOptions, setTargetOptions] = useState([]); @@ -122,7 +122,6 @@ export function SwapTradeForm() { ); const { value: tokenBalance } = useAssetBalanceOf(sourceToken); - const { state } = useLocation(); useEffect(() => { @@ -161,8 +160,28 @@ export function SwapTradeForm() { -
- +
+
+
+ +
+
+
+
+
{ + setTargetToken(sourceToken); + setSourceToken(targetToken); + setAmount('0'); + }} + > + + + +
+
+
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 945c11a57..d5696e3db 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -123,7 +123,8 @@ "receive": "You receive" }, "buttons": { - "submit": "Place Trade" + "submit": "Place Trade", + "switchAssets": "Switch Assets" } }, "amountField": {