@@ -17,6 +17,13 @@ import ChannelIcon from './ChannelIcon';
17
17
*/
18
18
export const ROW_HEIGHT = 60 ;
19
19
20
+ const BaseColumn = styled ( Column ) `
21
+ white-space: nowrap;
22
+ line-height: ${ ROW_HEIGHT } px;
23
+ padding-left: 5px;
24
+ padding-right: 5px;
25
+ ` ;
26
+
20
27
const Styled = {
21
28
Row : styled ( Row ) < { dimmed ?: boolean ; selectable ?: boolean } > `
22
29
border-bottom: 0.5px solid ${ props => props . theme . colors . darkGray } ;
@@ -35,43 +42,55 @@ const Styled = {
35
42
}
36
43
` }
37
44
` ,
38
- Column : styled ( Column ) < { last ?: boolean ; ellipse ?: boolean } > `
39
- white-space: nowrap;
40
- line-height: ${ ROW_HEIGHT } px;
41
- padding-left: 5px;
45
+ Column : styled ( BaseColumn ) < { last ?: boolean } > `
42
46
padding-right: ${ props => ( props . last ? '15' : '5' ) } px;
43
- ${ props =>
44
- props . ellipse &&
45
- `
46
- overflow: hidden;
47
- text-overflow: ellipsis;
48
- ` }
47
+ ` ,
48
+ ActionColumn : styled ( BaseColumn ) `
49
+ max-width: 50px;
50
+ padding-left: 24px;
51
+ ` ,
52
+ WideColumn : styled ( BaseColumn ) `
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+
56
+ @media (min-width: 1200px) and (max-width: 1300px) {
57
+ max-width: 20%;
58
+ }
49
59
` ,
50
60
StatusIcon : styled . span `
51
- float: left;
52
- margin-top: -1px;
53
- margin-left: 15px;
54
61
color: ${ props => props . theme . colors . pink } ;
55
62
` ,
56
63
Check : styled ( Checkbox ) `
57
- float: left;
58
- margin-top: 18px;
59
- margin-left: 10px;
64
+ margin-top: 17px;
60
65
` ,
61
66
Balance : styled ( ChannelBalance ) `
62
67
margin-top: ${ ROW_HEIGHT / 2 - 2 } px;
63
68
` ,
69
+ AliasTip : styled . div `
70
+ text-align: right;
71
+ ` ,
72
+ } ;
73
+
74
+ const ChannelAliasTip : React . FC < { channel : Channel } > = ( { channel } ) => {
75
+ return (
76
+ < Styled . AliasTip >
77
+ { channel . aliasDetail . split ( '\n' ) . map ( text => (
78
+ < div key = { text } > { text } </ div >
79
+ ) ) }
80
+ </ Styled . AliasTip >
81
+ ) ;
64
82
} ;
65
83
66
84
export const ChannelRowHeader : React . FC = ( ) => {
67
85
const { l } = usePrefixedTranslation ( 'cmps.loop.ChannelRowHeader' ) ;
68
- const { Column } = Styled ;
86
+ const { Column, ActionColumn , WideColumn } = Styled ;
69
87
return (
70
88
< Row >
89
+ < ActionColumn > </ ActionColumn >
71
90
< Column right >
72
91
< HeaderFour > { l ( 'canReceive' ) } </ HeaderFour >
73
92
</ Column >
74
- < Column cols = { 2 } colsXl = { 3 } > </ Column >
93
+ < WideColumn cols = { 2 } colsXl = { 3 } > </ WideColumn >
75
94
< Column >
76
95
< HeaderFour > { l ( 'canSend' ) } </ HeaderFour >
77
96
</ Column >
@@ -83,9 +102,9 @@ export const ChannelRowHeader: React.FC = () => {
83
102
< Column cols = { 1 } >
84
103
< HeaderFour > { l ( 'upTime' ) } </ HeaderFour >
85
104
</ Column >
86
- < Column cols = { 2 } >
105
+ < WideColumn cols = { 2 } >
87
106
< HeaderFour > { l ( 'peer' ) } </ HeaderFour >
88
- </ Column >
107
+ </ WideColumn >
89
108
< Column right last >
90
109
< HeaderFour > { l ( 'capacity' ) } </ HeaderFour >
91
110
</ Column >
@@ -110,37 +129,43 @@ const ChannelRow: React.FC<Props> = ({ channel, style }) => {
110
129
store . buildSwapStore . toggleSelectedChannel ( channel . chanId ) ;
111
130
} ;
112
131
113
- const { Row, Column, StatusIcon, Check, Balance } = Styled ;
132
+ const { Row, Column, ActionColumn , WideColumn , StatusIcon, Check, Balance } = Styled ;
114
133
return (
115
134
< Row
116
135
dimmed = { dimmed }
117
136
style = { style }
118
137
selectable = { editable && ! disabled }
119
138
onClick = { editable && ! disabled ? handleRowChecked : undefined }
120
139
>
121
- < Column right >
140
+ < ActionColumn >
122
141
{ editable ? (
123
142
< Check checked = { checked } disabled = { disabled } />
124
143
) : (
125
144
< StatusIcon >
126
145
< ChannelIcon channel = { channel } />
127
146
</ StatusIcon >
128
147
) }
148
+ </ ActionColumn >
149
+ < Column right >
129
150
< Unit sats = { channel . remoteBalance } suffix = { false } />
130
151
</ Column >
131
- < Column cols = { 2 } colsXl = { 3 } >
152
+ < WideColumn cols = { 2 } colsXl = { 3 } >
132
153
< Balance channel = { channel } />
133
- </ Column >
154
+ </ WideColumn >
134
155
< Column >
135
156
< Unit sats = { channel . localBalance } suffix = { false } />
136
157
</ Column >
137
158
< Column cols = { 1 } > { channel . remoteFeeRate } </ Column >
138
159
< Column cols = { 1 } > { channel . uptimePercent } </ Column >
139
- < Column cols = { 2 } ellipse >
140
- < Tip overlay = { channel . remotePubkey } placement = "left" capitalize = { false } >
160
+ < WideColumn cols = { 2 } >
161
+ < Tip
162
+ overlay = { < ChannelAliasTip channel = { channel } /> }
163
+ placement = "left"
164
+ capitalize = { false }
165
+ >
141
166
< span > { channel . aliasLabel } </ span >
142
167
</ Tip >
143
- </ Column >
168
+ </ WideColumn >
144
169
< Column right >
145
170
< Unit sats = { channel . capacity } suffix = { false } />
146
171
</ Column >
0 commit comments