Fix account display in session page

This commit is contained in:
Ilja 2022-03-04 14:24:12 +02:00
parent 1cd9228dad
commit 1d5f3fbd80

View File

@ -1,6 +1,8 @@
import AccountSelectCard from '@/components/AccountSelectCard' import AccountSelectCard from '@/components/AccountSelectCard'
import PageHeader from '@/components/PageHeader' import PageHeader from '@/components/PageHeader'
import ProjectInfoCard from '@/components/ProjectInfoCard' import ProjectInfoCard from '@/components/ProjectInfoCard'
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
import { cosmosAddresses } from '@/utils/CosmosWalletUtil' import { cosmosAddresses } from '@/utils/CosmosWalletUtil'
import { eip155Addresses } from '@/utils/EIP155WalletUtil' import { eip155Addresses } from '@/utils/EIP155WalletUtil'
import { isCosmosChain, isEIP155Chain } from '@/utils/HelperUtil' import { isCosmosChain, isEIP155Chain } from '@/utils/HelperUtil'
@ -74,15 +76,15 @@ export default function SessionPage() {
<ProjectInfoCard metadata={session.peer.metadata} /> <ProjectInfoCard metadata={session.peer.metadata} />
<Divider y={2} />
{chains.map(chain => { {chains.map(chain => {
if (isEIP155Chain(chain)) { if (isEIP155Chain(chain)) {
return ( return (
<Fragment key={chain}> <Fragment key={chain}>
<Divider y={2} />
<Row> <Row>
<Col> <Col>
<Text h5>EIP155 Accounts</Text> <Text h5>{`${EIP155_CHAINS[chain as TEIP155Chain].name} Accounts`}</Text>
{eip155Addresses.map((address, index) => { {eip155Addresses.map((address, index) => {
const fullAddress = `${chain}:${address}` const fullAddress = `${chain}:${address}`
const selected = accounts.includes(fullAddress) const selected = accounts.includes(fullAddress)
@ -106,11 +108,11 @@ export default function SessionPage() {
} else if (isCosmosChain(chain)) { } else if (isCosmosChain(chain)) {
return ( return (
<Fragment key={chain}> <Fragment key={chain}>
<Divider y={1} /> <Divider y={2} />
<Row> <Row>
<Col> <Col>
<Text h5>Cosmos Accounts</Text> <Text h5>{`${COSMOS_MAINNET_CHAINS[chain as TCosmosChain].name} Accounts`}</Text>
{cosmosAddresses.map((address, index) => { {cosmosAddresses.map((address, index) => {
const fullAddress = `${chain}:${address}` const fullAddress = `${chain}:${address}`
const selected = accounts.includes(fullAddress) const selected = accounts.includes(fullAddress)