Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 323e911

Browse files
authored
Add ellipsis effect to hidden beacon status (#8755)
1 parent 527da1c commit 323e911

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

res/css/components/views/beacon/_BeaconStatus.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ limitations under the License.
5555

5656
white-space: nowrap;
5757
overflow: hidden;
58+
59+
.mx_BeaconStatus_description_status {
60+
text-overflow: ellipsis;
61+
overflow: hidden;
62+
}
5863
}
5964

6065
.mx_BeaconStatus_expiryTime {

src/components/views/beacon/BeaconStatus.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ const BeaconStatus: React.FC<Props & HTMLProps<HTMLDivElement>> =
6363
/> }
6464
<div className='mx_BeaconStatus_description'>
6565

66-
{ displayStatus === BeaconDisplayStatus.Loading && <span>{ _t('Loading live location...') }</span> }
67-
{ displayStatus === BeaconDisplayStatus.Stopped && <span>{ _t('Live location ended') }</span> }
68-
69-
{ displayStatus === BeaconDisplayStatus.Error && <span>{ _t('Live location error') }</span> }
70-
66+
{ displayStatus === BeaconDisplayStatus.Loading &&
67+
<span className="mx_BeaconStatus_description_status">{ _t('Loading live location...') }</span>
68+
}
69+
{ displayStatus === BeaconDisplayStatus.Stopped &&
70+
<span className="mx_BeaconStatus_description_status">{ _t('Live location ended') }</span>
71+
}
72+
{ displayStatus === BeaconDisplayStatus.Error &&
73+
<span className="mx_BeaconStatus_description_status">{ _t('Live location error') }</span>
74+
}
7175
{ displayStatus === BeaconDisplayStatus.Active && beacon && <>
7276
<>
7377
<span className='mx_BeaconStatus_label'>{ label }</span>

test/components/views/beacon/__snapshots__/BeaconStatus-test.tsx.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ exports[`<BeaconStatus /> renders loading state 1`] = `
136136
<div
137137
className="mx_BeaconStatus_description"
138138
>
139-
<span>
139+
<span
140+
className="mx_BeaconStatus_description_status"
141+
>
140142
Loading live location...
141143
</span>
142144
</div>
@@ -165,7 +167,9 @@ exports[`<BeaconStatus /> renders stopped state 1`] = `
165167
<div
166168
className="mx_BeaconStatus_description"
167169
>
168-
<span>
170+
<span
171+
className="mx_BeaconStatus_description_status"
172+
>
169173
Live location ended
170174
</span>
171175
</div>

test/components/views/beacon/__snapshots__/OwnBeaconStatus-test.tsx.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ exports[`<OwnBeaconStatus /> renders without a beacon instance 1`] = `
1515
<div
1616
className="mx_BeaconStatus_description"
1717
>
18-
<span>
18+
<span
19+
className="mx_BeaconStatus_description_status"
20+
>
1921
Loading live location...
2022
</span>
2123
</div>

0 commit comments

Comments
 (0)