diff --git a/src/components/DepositCapMessage.tsx b/src/components/DepositCapMessage.tsx index 6053d4f0..6aaee248 100644 --- a/src/components/DepositCapMessage.tsx +++ b/src/components/DepositCapMessage.tsx @@ -33,7 +33,7 @@ export default function DepositCapMessage(props: Props) {
Cap Left: } />} } /> + } /> } /> } /> {ENABLE_PERPS && } />} diff --git a/src/components/Trade/TradeModule/AssetSelector/AssetSelectorPair.tsx b/src/components/Trade/TradeModule/AssetSelector/AssetSelectorPair.tsx index 77bcc6e2..5256ecf0 100644 --- a/src/components/Trade/TradeModule/AssetSelector/AssetSelectorPair.tsx +++ b/src/components/Trade/TradeModule/AssetSelector/AssetSelectorPair.tsx @@ -35,18 +35,21 @@ export default function AssetSelectorPair(props: Props) { }, []) return ( -
- - {buyAsset.symbol}/{sellAsset.symbol} - + <> -
+ ) } diff --git a/src/pages/ExecuteMessagePage.tsx b/src/pages/ExecuteMessagePage.tsx new file mode 100644 index 00000000..1a1a665f --- /dev/null +++ b/src/pages/ExecuteMessagePage.tsx @@ -0,0 +1,93 @@ +import { useState } from 'react' +import { useSearchParams } from 'react-router-dom' + +import Text from 'components/Text' +import WarningMessages from 'components/WarningMessages' +import { ENV } from 'constants/env' +import useStore from 'store' + +import ActionButton from '../components/Button/ActionButton' + +export default function ExecuteMessagePage() { + const [searchParams] = useSearchParams() + + const [contract, setContract] = useState( + searchParams.get('contract') ?? ENV.ADDRESS_CREDIT_MANAGER, + ) + const [message, setMessage] = useState(atob(searchParams.get('msg') ?? '')) + const [funds, setFunds] = useState(atob(searchParams.get('funds') ?? '')) + + const [messageWarnings, setMessageWarnings] = useState([]) + const [fundsWarnings, setFundsWarnings] = useState([]) + + const execute = useStore((s) => s.execute) + + function onChangeTextArea(value: string) { + setMessage(value) + + try { + if (value !== '') JSON.parse(value) + setMessageWarnings([]) + } catch { + setMessageWarnings(['Invalid JSON']) + } + } + + function onChangeFunds(value: string) { + setFunds(value) + + try { + if (value !== '') JSON.parse(value) + setFundsWarnings([]) + } catch { + setFundsWarnings(['Invalid JSON']) + } + } + + return ( +
+ Execute Custom Message + + +