Skip to content

Commit

Permalink
feat(neuron-ui): refine transaction list and address list
Browse files Browse the repository at this point in the history
1. set desc column responsive
2. update the ellipsis in address field
  • Loading branch information
Keith-CY committed Sep 11, 2019
1 parent a21bc7e commit e78dd9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 15 additions & 2 deletions packages/neuron-ui/src/components/Addresses/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,22 @@ const Addresses = ({
className: 'monospacedFont',
minWidth: 100,
maxWidth: 500,
onRender: (item?: State.Address) => {
onRender: (item?: State.Address, _index?: number, column?: IColumn) => {
if (item) {
if (column && (column.calculatedWidth || 0) < 400) {
return (
<div
title={item.address}
style={{
overflow: 'hidden',
display: 'flex',
}}
>
<span className="text-overflow">{item.address.slice(0, -6)}</span>
<span>{item.address.slice(-6)}</span>
</div>
)
}
return (
<span className="text-overflow" title={item.address}>
{item.address}
Expand All @@ -86,7 +100,6 @@ const Addresses = ({
key: 'description',
fieldName: 'description',
minWidth: 100,
maxWidth: 300,
onRender: (item?: State.Address) => {
const isSelected = item && localDescription.key === item.address
return item ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const TransactionList = ({
key: 'description',
fieldName: 'description',
minWidth: 100,
maxWidth: 100,
onRender: (item?: FormatTransaction) => {
const isSelected = item && localDescription.key === item.hash
return item ? (
Expand Down

0 comments on commit e78dd9f

Please sign in to comment.