diff --git a/apps/namadillo/src/App/Masp/MaspShield.tsx b/apps/namadillo/src/App/Masp/MaspShield.tsx index e5ada33c16..05fd4d0ca4 100644 --- a/apps/namadillo/src/App/Masp/MaspShield.tsx +++ b/apps/namadillo/src/App/Masp/MaspShield.tsx @@ -1,6 +1,5 @@ import { Panel } from "@namada/components"; import { AccountType } from "@namada/types"; -import { NamadaTransferTopHeader } from "App/NamadaTransfer/NamadaTransferTopHeader"; import { TransferModule } from "App/Transfer/TransferModule"; import { OnSubmitTransferParams } from "App/Transfer/types"; import { allDefaultAccountsAtom } from "atoms/accounts"; @@ -148,11 +147,8 @@ export const MaspShield = ({ return ( -
- +
+ Shield Assets
-
- +
+ Unshield Assets
-
- +
+ {`${isSourceShielded ? "Shielded" : "Transparent"} Transfer Assets`}
void; onChangeMemo?: (address: string) => void; - setDestinationAddress?: (address: string) => void; }; export const TransferDestination = ({ @@ -67,14 +64,12 @@ export const TransferDestination = ({ sourceAddress, memo, sourceAsset, - setDestinationAddress, + onChangeAddress, onChangeMemo, }: TransferDestinationProps): JSX.Element => { const { data: accounts } = useAtomValue(allDefaultAccountsAtom); const [isModalOpen, setIsModalOpen] = useState(false); const location = useLocation(); - const connectedWallets = useAtomValue(connectedWalletsAtom); - const keplr = new KeplrWalletManager(); const isIbcTransfer = isIbcAddress(sourceAddress ?? ""); const changeFeeEnabled = !isIbcTransfer; @@ -99,36 +94,24 @@ export const TransferDestination = ({ }; const handleSelectAddress = useCallback( - async (selectedAddress: Address): Promise => { - const isIbcAsset = !isNamadaAddress(selectedAddress); - if (isIbcAsset) { - await keplr.connectAllKeplrChains(); - } - setDestinationAddress?.(selectedAddress); - }, - [keplr, setDestinationAddress] + (selectedAddress: Address): void => onChangeAddress?.(selectedAddress), + [onChangeAddress] ); const isShieldingTransaction = routes.shield === location.pathname || routes.ibc === location.pathname; - // Make sure destination address isnt ibc if keplr is not connected - useEffect(() => { - if (isIbcAddress(destinationAddress ?? "") && !connectedWallets.keplr) - setDestinationAddress?.(""); - }, [connectedWallets.keplr, destinationAddress, setDestinationAddress]); - // Make sure destination address is pre-filled if it's a shielding transaction useEffect(() => { if (destinationAddress) return; if (isShieldingTransaction && shieldedAccount?.address) { - setDestinationAddress?.(shieldedAccount?.address ?? ""); + onChangeAddress?.(shieldedAccount?.address ?? ""); } }, [ isShieldingTransaction, shieldedAccount?.address, destinationAddress, - setDestinationAddress, + onChangeAddress, ]); // Write a customAddress variable that checks if the address doesn't come from our transparent or shielded accounts diff --git a/apps/namadillo/src/App/Transfer/TransferModule.tsx b/apps/namadillo/src/App/Transfer/TransferModule.tsx index 3f509304a8..4004506ce9 100644 --- a/apps/namadillo/src/App/Transfer/TransferModule.tsx +++ b/apps/namadillo/src/App/Transfer/TransferModule.tsx @@ -213,7 +213,6 @@ export const TransferModule = ({ />