Skip to content

Commit e78dd9f

Browse files
committed
feat(neuron-ui): refine transaction list and address list
1. set desc column responsive 2. update the ellipsis in address field
1 parent a21bc7e commit e78dd9f

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

packages/neuron-ui/src/components/Addresses/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,22 @@ const Addresses = ({
7070
className: 'monospacedFont',
7171
minWidth: 100,
7272
maxWidth: 500,
73-
onRender: (item?: State.Address) => {
73+
onRender: (item?: State.Address, _index?: number, column?: IColumn) => {
7474
if (item) {
75+
if (column && (column.calculatedWidth || 0) < 400) {
76+
return (
77+
<div
78+
title={item.address}
79+
style={{
80+
overflow: 'hidden',
81+
display: 'flex',
82+
}}
83+
>
84+
<span className="text-overflow">{item.address.slice(0, -6)}</span>
85+
<span>{item.address.slice(-6)}</span>
86+
</div>
87+
)
88+
}
7589
return (
7690
<span className="text-overflow" title={item.address}>
7791
{item.address}
@@ -86,7 +100,6 @@ const Addresses = ({
86100
key: 'description',
87101
fieldName: 'description',
88102
minWidth: 100,
89-
maxWidth: 300,
90103
onRender: (item?: State.Address) => {
91104
const isSelected = item && localDescription.key === item.address
92105
return item ? (

packages/neuron-ui/src/components/TransactionList/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ const TransactionList = ({
172172
key: 'description',
173173
fieldName: 'description',
174174
minWidth: 100,
175-
maxWidth: 100,
176175
onRender: (item?: FormatTransaction) => {
177176
const isSelected = item && localDescription.key === item.hash
178177
return item ? (

0 commit comments

Comments
 (0)