Skip to content

Commit 6c16b59

Browse files
committed
channels: prevent ellipsed amounts on smaller screen resolutions
1 parent 3da8388 commit 6c16b59

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

app/src/components/base/grid.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ export const Row: React.FC<{
2323
*/
2424
export const Column: React.FC<{
2525
cols?: number;
26+
colsXl?: number;
2627
right?: boolean;
2728
className?: string;
28-
}> = ({ cols, right, children, className }) => {
29-
const cn: string[] = [];
30-
cn.push(cols ? `col-${cols}` : 'col');
29+
}> = ({ cols, colsXl, right, children, className }) => {
30+
const cn: string[] = ['col'];
31+
cols && cn.push(`col-${cols}`);
32+
colsXl && cn.push(`col-xl-${colsXl}`);
3133
className && cn.push(className);
3234
right && cn.push('text-right');
3335
return <div className={cn.join(' ')}>{children}</div>;

app/src/components/loop/ChannelRow.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ const Styled = {
3636
}
3737
`}
3838
`,
39-
Column: styled(Column)<{ last?: boolean }>`
39+
Column: styled(Column)<{ last?: boolean; ellipse?: boolean }>`
4040
white-space: nowrap;
4141
line-height: ${ROW_HEIGHT}px;
42-
overflow: hidden;
43-
text-overflow: ellipsis;
4442
padding-left: 5px;
4543
padding-right: ${props => (props.last ? '15' : '5')}px;
44+
${props =>
45+
props.ellipse &&
46+
`
47+
overflow: hidden;
48+
text-overflow: ellipsis;
49+
`}
4650
`,
4751
StatusIcon: styled.span`
4852
float: left;
@@ -68,7 +72,7 @@ export const ChannelRowHeader: React.FC = () => {
6872
<Column right>
6973
<HeaderFour>{l('canReceive')}</HeaderFour>
7074
</Column>
71-
<Column cols={3}></Column>
75+
<Column cols={2} colsXl={3}></Column>
7276
<Column>
7377
<HeaderFour>{l('canSend')}</HeaderFour>
7478
</Column>
@@ -138,15 +142,15 @@ const ChannelRow: React.FC<Props> = ({ channel, style }) => {
138142
)}
139143
<Unit sats={channel.remoteBalance} suffix={false} />
140144
</Column>
141-
<Column cols={3}>
145+
<Column cols={2} colsXl={3}>
142146
<Balance channel={channel} />
143147
</Column>
144148
<Column>
145149
<Unit sats={channel.localBalance} suffix={false} />
146150
</Column>
147151
<Column cols={1}>{channel.remoteFeeRate}</Column>
148152
<Column cols={1}>{channel.uptimePercent}</Column>
149-
<Column cols={2}>
153+
<Column cols={2} ellipse>
150154
<Tip overlay={channel.remotePubkey} placement="left" capitalize={false}>
151155
<span>{channel.aliasLabel}</span>
152156
</Tip>

0 commit comments

Comments
 (0)