diff --git a/apps/rosen/app/(bridge)/BridgeForm.tsx b/apps/rosen/app/(bridge)/BridgeForm.tsx index 412348df..e98d4f56 100644 --- a/apps/rosen/app/(bridge)/BridgeForm.tsx +++ b/apps/rosen/app/(bridge)/BridgeForm.tsx @@ -1,7 +1,6 @@ 'use client'; import { useCallback, ChangeEvent } from 'react'; -import Image from 'next/image'; import { getDecimalString, getNonDecimalString } from '@rosen-ui/utils'; import { @@ -14,6 +13,7 @@ import { MenuItem, Button, CircularProgress, + SvgIcon, } from '@rosen-bridge/ui-kit'; import useBridgeForm from '@/_hooks/useBridgeForm'; @@ -100,9 +100,12 @@ const BridgeForm = () => { const network = availableNetworks.find( (network) => network.name === value, )!; + const Logo = network.logo; return ( - network logo + + + {network.label} ); @@ -227,15 +230,12 @@ const BridgeForm = () => { }} onChange={handleSourceChange} > - {availableNetworks.map((network) => ( + {availableNetworks.map(({ logo: Logo, ...network }) => ( - network logo + + + {network.label} @@ -257,15 +257,14 @@ const BridgeForm = () => { }} onChange={handleTargetChange} > - {targetNetworks.map((network) => ( + {targetNetworks.map(({ logo: Logo, ...network }) => ( - network logo + + + + + {network.label} diff --git a/apps/rosen/app/_networks/cardano/index.ts b/apps/rosen/app/_networks/cardano/index.ts index 507c3c8f..31ddec8d 100644 --- a/apps/rosen/app/_networks/cardano/index.ts +++ b/apps/rosen/app/_networks/cardano/index.ts @@ -12,12 +12,12 @@ import { Network } from '@/_types/network'; import { decodeWasmValue } from '@/_actions/cardanoDecoder'; import { Wallet } from '@rosen-ui/wallet-api'; import { RosenChainToken } from '@rosen-bridge/tokens'; -import { getDecimalString } from '@rosen-ui/utils'; import { generateLockAuxiliaryData, setTxWitnessSet, } from './transaction/utils'; import { generateUnsignedTx } from './transaction/generateTx'; +import { CardanoIcon } from '@rosen-bridge/icons'; /** * the main object for Cardano network @@ -89,7 +89,7 @@ const CardanoNetwork: Network = { }, ]), nextHeightInterval: 25, - logo: '/cardano.svg', + logo: CardanoIcon, api: { explorerUrl: 'https://api.koios.rest/api', }, diff --git a/apps/rosen/app/_networks/ergo/index.ts b/apps/rosen/app/_networks/ergo/index.ts index 7277d21b..48b7b912 100644 --- a/apps/rosen/app/_networks/ergo/index.ts +++ b/apps/rosen/app/_networks/ergo/index.ts @@ -10,6 +10,7 @@ import { Network } from '@/_types/network'; import { ErgoToken, Wallet } from '@rosen-ui/wallet-api'; import { generateUnsignedTx } from './transaction/generateTx'; import { RosenChainToken } from '@rosen-bridge/tokens'; +import { ErgoIcon } from '@rosen-bridge/icons'; /** * the main object for Ergo network @@ -71,7 +72,7 @@ const ErgoNetwork: Network = { }, }, ]), - logo: '/ergo.svg', + logo: ErgoIcon, nextHeightInterval: 5, api: { explorerUrl: 'https://api.ergoplatform.com/', diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts index 1e4d7cbb..d380f475 100644 --- a/packages/icons/src/index.ts +++ b/packages/icons/src/index.ts @@ -1,3 +1,4 @@ +export * from './networks'; export * from './wallets'; export { ReactComponent as AngleDown } from './icons/angle-down.svg'; diff --git a/apps/rosen/public/cardano.svg b/packages/icons/src/networks/cardano.svg similarity index 99% rename from apps/rosen/public/cardano.svg rename to packages/icons/src/networks/cardano.svg index c1895147..964a4554 100644 --- a/apps/rosen/public/cardano.svg +++ b/packages/icons/src/networks/cardano.svg @@ -2,9 +2,6 @@ -