Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/pages/Account/TransactionRows/BridgeTransactionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
TypeDetails,
} from '../Account.styles'
import { type BridgeTransaction } from '../Account.types'
import { bridgeIdToDisplayNameMap } from '../accountUtils'
import { TokenIcon } from '../TokenIcon'

interface BridgeTransactionRowProps {
Expand Down Expand Up @@ -83,7 +84,7 @@ export function BridgeTransactionRow({ transaction }: BridgeTransactionRowProps)
<Box color="#8780BF" fontWeight="600">
{type}
</Box>
<Box fontWeight="600">{bridgeId}</Box>
<Box fontWeight="600">{bridgeIdToDisplayNameMap[bridgeId]}</Box>
</TypeDetails>

<TransactionDetails>
Expand Down
10 changes: 10 additions & 0 deletions src/pages/Account/accountUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import EtherLogo from '../../assets/images/ether-logo.png'
import PolygonMaticLogo from '../../assets/images/polygon-matic-logo.svg'
import XDAILogo from '../../assets/images/xdai-logo.png'
import { BridgeList } from '../../services/EcoBridge/EcoBridge.types'
import { TransactionDetails } from '../../state/transactions/reducer'
import { type BridgeTransaction, type Transaction, TransactionStatus } from './Account.types'

Expand All @@ -18,6 +19,15 @@ const expressions = {
type: new RegExp('^(?<type>[A-Za-z]+)'),
}

export const bridgeIdToDisplayNameMap: { [k in BridgeList]: string } = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we usually type global constant names with UPPER_CASE convention

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree here

'arbitrum:mainnet': 'Arbitrum',
'arbitrum:testnet': 'Arbitrum Testnet',
'omnibridge:eth-xdai': 'Omnibridge',
connext: 'Connext',
socket: 'Socket',
xdai: 'xDai',
}

export const formattedTransactions = (
transactions: { [txHash: string]: TransactionDetails },
bridgeTransactions: BridgeTransaction[],
Expand Down