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

Add ellipsis effect to hidden beacon status #8755

Merged
merged 1 commit into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions res/css/components/views/beacon/_BeaconStatus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ limitations under the License.

white-space: nowrap;
overflow: hidden;

.mx_BeaconStatus_description_status {
text-overflow: ellipsis;
overflow: hidden;
}
}

.mx_BeaconStatus_expiryTime {
Expand Down
14 changes: 9 additions & 5 deletions src/components/views/beacon/BeaconStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ const BeaconStatus: React.FC<Props & HTMLProps<HTMLDivElement>> =
/> }
<div className='mx_BeaconStatus_description'>

{ displayStatus === BeaconDisplayStatus.Loading && <span>{ _t('Loading live location...') }</span> }
{ displayStatus === BeaconDisplayStatus.Stopped && <span>{ _t('Live location ended') }</span> }

{ displayStatus === BeaconDisplayStatus.Error && <span>{ _t('Live location error') }</span> }

{ displayStatus === BeaconDisplayStatus.Loading &&
<span className="mx_BeaconStatus_description_status">{ _t('Loading live location...') }</span>
}
{ displayStatus === BeaconDisplayStatus.Stopped &&
<span className="mx_BeaconStatus_description_status">{ _t('Live location ended') }</span>
}
{ displayStatus === BeaconDisplayStatus.Error &&
<span className="mx_BeaconStatus_description_status">{ _t('Live location error') }</span>
}
{ displayStatus === BeaconDisplayStatus.Active && beacon && <>
<>
<span className='mx_BeaconStatus_label'>{ label }</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ exports[`<BeaconStatus /> renders loading state 1`] = `
<div
className="mx_BeaconStatus_description"
>
<span>
<span
className="mx_BeaconStatus_description_status"
>
Loading live location...
</span>
</div>
Expand Down Expand Up @@ -165,7 +167,9 @@ exports[`<BeaconStatus /> renders stopped state 1`] = `
<div
className="mx_BeaconStatus_description"
>
<span>
<span
className="mx_BeaconStatus_description_status"
>
Live location ended
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ exports[`<OwnBeaconStatus /> renders without a beacon instance 1`] = `
<div
className="mx_BeaconStatus_description"
>
<span>
<span
className="mx_BeaconStatus_description_status"
>
Loading live location...
</span>
</div>
Expand Down