-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '292-update-flow-to-start-off-ramping-from-evm-networks'…
… into account-for-min-balance-assethub
- Loading branch information
Showing
31 changed files
with
326 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { FC, HTMLAttributes } from 'preact/compat'; | ||
import { useGetNetworkIcon, NetworkIconType } from '../../hooks/useGetNetworkIcon'; | ||
import { useGetNetworkIcon } from '../../hooks/useGetNetworkIcon'; | ||
import { getNetworkDisplayName, Networks } from '../../helpers/networks'; | ||
|
||
interface Props extends HTMLAttributes<HTMLImageElement> { | ||
chainId: NetworkIconType; | ||
network: Networks; | ||
} | ||
|
||
export const NetworkIcon: FC<Props> = ({ chainId, ...props }) => { | ||
const iconSrc = useGetNetworkIcon(chainId); | ||
export const NetworkIcon: FC<Props> = ({ network, ...props }) => { | ||
const iconSrc = useGetNetworkIcon(network); | ||
|
||
if (iconSrc) return <img src={iconSrc} alt={chainId} {...props} />; | ||
if (iconSrc) return <img src={iconSrc} alt={getNetworkDisplayName(network)} {...props} />; | ||
|
||
return <></>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { isNetworkEVM, useNetwork } from '../../../contexts/network'; | ||
import { isNetworkEVM } from '../../../helpers/networks'; | ||
import { useNetwork } from '../../../contexts/network'; | ||
import { EVMWalletButton } from '../EVMWalletButton'; | ||
import { PolkadotWalletButton } from '../PolkadotWalletButton'; | ||
|
||
export const ConnectWalletButton = ({ customStyles, hideIcon }: { customStyles?: string; hideIcon?: boolean }) => { | ||
const { selectedNetwork } = useNetwork(); | ||
|
||
if (!isNetworkEVM(selectedNetwork)) { | ||
return <PolkadotWalletButton customStyles={customStyles} hideIcon={hideIcon} />; | ||
if (isNetworkEVM(selectedNetwork)) { | ||
return <EVMWalletButton customStyles={customStyles} hideIcon={hideIcon} />; | ||
} | ||
|
||
return <EVMWalletButton customStyles={customStyles} hideIcon={hideIcon} />; | ||
return <PolkadotWalletButton customStyles={customStyles} hideIcon={hideIcon} />; | ||
}; |
Oops, something went wrong.