@@ -53,10 +53,10 @@ const defaultPCSuffixAddressSize =
53
53
const defaultPCSuffixPosAddressSize = 10 ;
54
54
const defaultMobileSuffixAddressSize = 4 ;
55
55
56
- const getAddressLabelInfo = ( label , alias ) => {
56
+ const getAddressLabelInfo = label => {
57
57
if ( label ) {
58
58
return {
59
- label : ` ${ label } ${ alias ? ` ( ${ alias } )` : '' } ` ,
59
+ label,
60
60
icon : (
61
61
< IconWrapper >
62
62
< Text
@@ -74,7 +74,7 @@ const getAddressLabelInfo = (label, alias) => {
74
74
} ;
75
75
}
76
76
return {
77
- label : alias ,
77
+ label : '' ,
78
78
icon : null ,
79
79
} ;
80
80
} ;
@@ -94,10 +94,11 @@ const RenderAddress = ({
94
94
prefix = null ,
95
95
suffix = null ,
96
96
type = 'pow' ,
97
+ addressLabel = '' ,
97
98
} : any ) => {
98
99
const aftercontent =
99
100
type === 'pow'
100
- ? cfxAddress && ! isFull && ! alias
101
+ ? cfxAddress && ! isFull && ! addressLabel && ! alias
101
102
? cfxAddress . substr ( - suffixSize )
102
103
: ''
103
104
: '' ;
@@ -129,7 +130,7 @@ const RenderAddress = ({
129
130
alias = { alias }
130
131
aftercontent = { aftercontent }
131
132
>
132
- < span > { content || alias || cfxAddress } </ span >
133
+ < span > { content || addressLabel || alias || cfxAddress } </ span >
133
134
</ LinkWrapper >
134
135
) ;
135
136
}
@@ -141,15 +142,42 @@ const RenderAddress = ({
141
142
alias = { alias }
142
143
aftercontent = { aftercontent }
143
144
>
144
- < span > { content || alias || cfxAddress } </ span >
145
+ < span > { content || addressLabel || alias || cfxAddress } </ span >
145
146
</ PlainWrapper >
146
147
) ;
147
148
}
148
149
149
150
return (
150
151
< AddressWrapper >
151
152
{ prefix }
152
- < Text span hoverValue = { hoverValue || cfxAddress } >
153
+ < Text
154
+ span
155
+ hoverValue = {
156
+ < >
157
+ { addressLabel ? (
158
+ < >
159
+ < span >
160
+ < Translation >
161
+ { t => t ( translations . profile . address . myNameTag ) }
162
+ </ Translation >
163
+ </ span >
164
+ { addressLabel }
165
+ </ >
166
+ ) : null }
167
+ < div > { hoverValue || cfxAddress } </ div >
168
+ { addressLabel && alias ? (
169
+ < >
170
+ < span >
171
+ < Translation >
172
+ { t => t ( translations . profile . address . publicNameTag ) }
173
+ </ Translation >
174
+ </ span >
175
+ { alias }
176
+ </ >
177
+ ) : null }
178
+ </ >
179
+ }
180
+ >
153
181
{ text }
154
182
</ Text >
155
183
{ suffix }
@@ -199,7 +227,6 @@ export const AddressContainer = withTranslation()(
199
227
globalData [ LOCALSTORAGE_KEYS_MAP . addressLabel ] [
200
228
formatAddress ( contractCreated )
201
229
] ,
202
- alias || txtContractCreation ,
203
230
) ;
204
231
205
232
addressLabel = label ;
@@ -208,7 +235,8 @@ export const AddressContainer = withTranslation()(
208
235
209
236
return RenderAddress ( {
210
237
cfxAddress : '' ,
211
- alias : addressLabel ,
238
+ alias : alias || txtContractCreation ,
239
+ addressLabel,
212
240
hoverValue : formatAddress ( contractCreated ) ,
213
241
hrefAddress : formatAddress ( contractCreated ) ,
214
242
link,
@@ -311,7 +339,6 @@ export const AddressContainer = withTranslation()(
311
339
globalData [ LOCALSTORAGE_KEYS_MAP . addressLabel ] [
312
340
formatAddress ( cfxAddress )
313
341
] ,
314
- alias ,
315
342
) ;
316
343
317
344
addressLabel = label ;
@@ -328,7 +355,8 @@ export const AddressContainer = withTranslation()(
328
355
) ;
329
356
return RenderAddress ( {
330
357
cfxAddress,
331
- alias : addressLabel ,
358
+ alias,
359
+ addressLabel,
332
360
link,
333
361
isFull,
334
362
maxWidth,
@@ -362,7 +390,8 @@ export const AddressContainer = withTranslation()(
362
390
if ( isMe ) {
363
391
return RenderAddress ( {
364
392
cfxAddress,
365
- alias : addressLabel ,
393
+ alias,
394
+ addressLabel,
366
395
link,
367
396
isFull,
368
397
maxWidth,
@@ -385,7 +414,8 @@ export const AddressContainer = withTranslation()(
385
414
386
415
return RenderAddress ( {
387
416
cfxAddress,
388
- alias : addressLabel ,
417
+ alias,
418
+ addressLabel,
389
419
link,
390
420
isFull,
391
421
maxWidth,
@@ -539,7 +569,7 @@ const addressStyle = (props: any) => `
539
569
display: inline-flex !important;
540
570
flex-wrap: nowrap;
541
571
max-width: ${
542
- props . maxwidth || ( props . alias ? 180 : defaultPCMaxWidth )
572
+ props . maxwidth || ( props . alias ? 160 : defaultPCMaxWidth )
543
573
} px !important;
544
574
outline: none;
545
575
@@ -552,7 +582,7 @@ const addressStyle = (props: any) => `
552
582
553
583
${ media . m } {
554
584
max-width: ${
555
- props . maxwidth || ( props . alias ? 160 : defaultMobileMaxWidth )
585
+ props . maxwidth || ( props . alias ? 140 : defaultMobileMaxWidth )
556
586
} px !important;
557
587
}
558
588
0 commit comments