Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
feat: Add token address in asset list (#3096)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Dec 6, 2021
1 parent 73ec99e commit ca010e9
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/routes/safe/components/Balances/AssetTableCell/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { ReactElement } from 'react'
import { ExplorerButton } from '@gnosis.pm/safe-react-components'
import styled from 'styled-components'

import Block from 'src/components/layout/Block'
import Img from 'src/components/layout/Img'
import Paragraph from 'src/components/layout/Paragraph'
import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils'
import { getExplorerInfo } from 'src/config'
import { BalanceData } from '../dataFetcher'

const AssetTableCell = (props): ReactElement => {
const { asset } = props
const StyledParagraph = styled(Paragraph)`
margin-left: 10px;
margin-right: 10px;
`

return (
<Block justify="left">
<Img alt={asset.name} height={26} onError={setImageToPlaceholder} src={asset.logoUri} />
<Paragraph noMargin size="lg" style={{ marginLeft: 10 }}>
{asset.name}
</Paragraph>
</Block>
)
}
const AssetTableCell = ({ asset }: { asset: BalanceData['asset'] }): ReactElement => (
<Block justify="left">
<Img alt={asset.name} height={26} onError={setImageToPlaceholder} src={asset.logoUri} />
<StyledParagraph noMargin size="lg">
{asset.name}
</StyledParagraph>
<ExplorerButton explorerUrl={getExplorerInfo(asset.address)} />
</Block>
)

export default AssetTableCell

0 comments on commit ca010e9

Please sign in to comment.