Skip to content

Commit

Permalink
didnt move all shared logic
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger committed Oct 29, 2024
1 parent 59ffaf4 commit 5892e4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
22 changes: 6 additions & 16 deletions web/src/components/DepositCard/DepositCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useEffect, useMemo, useState } from "react";

import { Dec, DecUtils } from "@keplr-wallet/unit";
import AnimatedArrowSpacer from "components/AnimatedDownArrowSpacer/AnimatedDownArrowSpacer";
import Dropdown, { type DropdownOption } from "components/Dropdown/Dropdown";
import { useConfig, type EvmChainInfo, type IbcChainInfo } from "config";
import Dropdown from "components/Dropdown/Dropdown";
import { useConfig } from "config";
import { useEvmChainSelection } from "features/EthWallet";
import { sendIbcTransfer, useIbcChainSelection } from "features/KeplrWallet";
import { useNotifications, NotificationType } from "features/Notifications";
Expand All @@ -18,6 +18,7 @@ export default function DepositCard(): React.ReactElement {
selectEvmChain,
evmChainsOptions,
selectedEvmChain,
selectedEvmChainOption,
defaultEvmCurrencyOption,
selectEvmCurrency,
evmCurrencyOptions,
Expand All @@ -31,27 +32,16 @@ export default function DepositCard(): React.ReactElement {
selectIbcChain,
ibcChainsOptions,
selectedIbcChain,
selectedIbcChainOption,
defaultIbcCurrencyOption,
selectIbcCurrency,
ibcCurrencyOptions,
selectedIbcCurrency,
defaultIbcCurrencyOption,
selectedIbcChainOption,
ibcCurrencyOptions,
ibcBalance,
isLoadingIbcBalance,
connectKeplrWallet,
} = useIbcChainSelection(ibcChains);

const selectedEvmChainOption = useMemo(() => {
if (!selectedEvmChain) {
return null;
}
return {
label: selectedEvmChain?.chainName || "",
value: selectedEvmChain,
leftIconClass: selectedEvmChain?.iconClass || "",
} as DropdownOption<EvmChainInfo>;
}, [selectedEvmChain]);

// the evm currency selection is controlled by the sender's chosen ibc currency,
// and should be updated when an ibc currency or evm chain is selected
const selectedEvmCurrencyOption = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/WithdrawCard/WithdrawCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type React from "react";
import { useEffect, useMemo, useState } from "react";

import { useConfig, type EvmChainInfo, type IbcChainInfo } from "config";
import { useConfig } from "config";
import AnimatedArrowSpacer from "components/AnimatedDownArrowSpacer/AnimatedDownArrowSpacer";
import Dropdown, { type DropdownOption } from "components/Dropdown/Dropdown";
import Dropdown from "components/Dropdown/Dropdown";
import {
getAstriaWithdrawerService,
useEthWallet,
Expand Down

0 comments on commit 5892e4a

Please sign in to comment.