Skip to content

Commit

Permalink
Add ellipsis effect to hidden beacon status (matrix-org#8755)
Browse files Browse the repository at this point in the history
  • Loading branch information
luixxiul authored and JanBurp committed Jun 14, 2022
1 parent 30a820f commit 8a891a6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
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

0 comments on commit 8a891a6

Please sign in to comment.