diff --git a/index.html b/index.html index ad4ac65..87c6088 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + diff --git a/package.json b/package.json index 9e8eb4e..4e62fdc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.8.0", + "version": "0.8.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Bridge/BridgeGhostAddress.jsx b/src/containers/Bridge/BridgeGhostAddress.jsx index 80975ee..fe75baa 100644 --- a/src/containers/Bridge/BridgeGhostAddress.jsx +++ b/src/containers/Bridge/BridgeGhostAddress.jsx @@ -1,5 +1,6 @@ import { useState, useEffect } from "react"; import { ss58Decode } from "@polkadot-labs/hdkd-helpers"; +import { FormControl, OutlinedInput } from "@mui/material"; import CheckIcon from '@mui/icons-material/CheckCircle'; import CancelIcon from '@mui/icons-material/Cancel'; @@ -9,7 +10,7 @@ import GhostStyledIcon from "../../components/Icon/GhostIcon"; import { shorten } from "../../helpers"; -export const BridgeGhostAddressCard = ({ receiver, setReceiver }) => { +export const BridgeGhostAddressCard = ({ receiver, setReceiver, isCard }) => { const [inputFocused, setInputFocused] = useState(false); const [innerReceiver, setInnerReceiver] = useState(receiver); @@ -25,26 +26,50 @@ export const BridgeGhostAddressCard = ({ receiver, setReceiver }) => { } }, [innerReceiver]); + if (isCard) { + return ( + setInputFocused(true)} + onFocus={() => setInputFocused(false)} + onMouseLeave={() => setInputFocused(true)} + onMouseEnter={() => setInputFocused(false)} + onChange={event => setInnerReceiver(event.currentTarget.value)} + placeholder={receiver ? shorten(receiver, 15, -10) : "GHOST address (sf prefixed)"} + value={receiver ? "" : innerReceiver} + inputProps={{ "data-testid": "fromInput" }} + endString={receiver + ? + : inputFocused && !receiver + ? + : undefined + } + type="text" + maxWidth="100%" + /> + ) + } + return ( - setInputFocused(true)} - onFocus={() => setInputFocused(false)} - onMouseLeave={() => setInputFocused(true)} - onMouseEnter={() => setInputFocused(false)} - onChange={event => setInnerReceiver(event.currentTarget.value)} - placeholder={receiver ? shorten(receiver, 15, -10) : "GHOST address (sf prefixed)"} - value={receiver ? "" : innerReceiver} - inputProps={{ "data-testid": "fromInput" }} - endString={receiver - ? - : inputFocused && !receiver - ? - : undefined - } - type="text" - maxWidth="100%" - /> + + setInputFocused(true)} + onFocus={() => setInputFocused(false)} + onMouseLeave={() => setInputFocused(true)} + onMouseEnter={() => setInputFocused(false)} + onChange={event => setInnerReceiver(event.currentTarget.value)} + placeholder={receiver ? shorten(receiver, 15, -10) : "GHOST address (sf prefixed)"} + value={receiver ? "" : innerReceiver} + endAdornment={receiver + ? + : inputFocused && !receiver + ? + : undefined + } + /> + ) } diff --git a/src/containers/Bridge/BridgeSettingsModal.jsx b/src/containers/Bridge/BridgeSettingsModal.jsx index 8ecd3dd..f035fd4 100644 --- a/src/containers/Bridge/BridgeSettingsModal.jsx +++ b/src/containers/Bridge/BridgeSettingsModal.jsx @@ -39,7 +39,7 @@ export const BridgeInSettingsModal = ({ isOpen, onClose, decimals, setDecimals, - Recipient address of swapped assets and liquidity tokens + Custom recipient address of bridged assets diff --git a/src/containers/Dex/Dex.jsx b/src/containers/Dex/Dex.jsx index f067d52..cdcdd06 100644 --- a/src/containers/Dex/Dex.jsx +++ b/src/containers/Dex/Dex.jsx @@ -67,7 +67,7 @@ const Dex = ({ chainId, address, connect, config }) => { const { data: secondsToWait } = useStorageValue(chainId, address, DEADLINE_PREFIX, "60"); const { data: slippage } = useStorageValue(chainId, address, SLIPPAGE_PREFIX, "5"); const { data: formatDecimals } = useStorageValue(chainId, address, DECIMALS_PREFIX, "5"); - const { data: actualDestinationAddress } = useStorageValue(chainId, address, DECIMALS_PREFIX, address); + const { data: actualDestinationAddress } = useStorageValue(chainId, address, DESTINATION_PREFIX, address); const [destinationAddress, setDestinationAddress] = useState(actualDestinationAddress); const [tokenAddressTop, setTokenAddressTop] = useState(EMPTY_ADDRESS); @@ -292,7 +292,7 @@ const Dex = ({ chainId, address, connect, config }) => { - Transaction deadline + Transaction deadline { - Decimal representation + Decimal representation { - + {`${actualDestinationAddress ? "Custom" : "Default"} destination address`}