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

Commit e1d631c

Browse files
authored
Improve Voice Broadcast header layout (#9437)
* Fix Voice Broadcast live badge position * Prevent voice broadcast header overflow * Fix VoiceBroadcastPlaybackBody-test
1 parent 788dd90 commit e1d631c

File tree

6 files changed

+34
-7
lines changed

6 files changed

+34
-7
lines changed

res/css/voice-broadcast/atoms/_VoiceBroadcastHeader.pcss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ limitations under the License.
2020
width: 266px;
2121
}
2222

23+
.mx_VoiceBroadcastHeader_content {
24+
flex-grow: 1;
25+
min-width: 0;
26+
}
27+
2328
.mx_VoiceBroadcastHeader_room {
2429
font-size: $font-12px;
2530
font-weight: $font-semi-bold;
@@ -34,4 +39,14 @@ limitations under the License.
3439
font-size: $font-12px;
3540
display: flex;
3641
gap: $spacing-4;
42+
43+
i {
44+
flex-shrink: 0;
45+
}
46+
47+
span {
48+
overflow: hidden;
49+
text-overflow: ellipsis;
50+
white-space: nowrap;
51+
}
3752
}

src/voice-broadcast/components/atoms/VoiceBroadcastHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const VoiceBroadcastHeader: React.FC<VoiceBroadcastHeaderProps> = ({
4747
</div>
4848
<div className="mx_VoiceBroadcastHeader_line">
4949
<Icon type={IconType.Microphone} colour={IconColour.CompoundSecondaryContent} />
50-
{ sender.name }
50+
<span>{ sender.name }</span>
5151
</div>
5252
{ broadcast }
5353
</div>

test/voice-broadcast/components/atoms/__snapshots__/VoiceBroadcastHeader-test.tsx.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ exports[`VoiceBroadcastHeader when rendering a live broadcast header with broadc
2828
role="presentation"
2929
style="mask-image: url(\\"image-file-stub\\");"
3030
/>
31-
test user
31+
<span>
32+
test user
33+
</span>
3234
</div>
3335
<div
3436
class="mx_VoiceBroadcastHeader_line"
@@ -85,7 +87,9 @@ exports[`VoiceBroadcastHeader when rendering a non-live broadcast header should
8587
role="presentation"
8688
style="mask-image: url(\\"image-file-stub\\");"
8789
/>
88-
test user
90+
<span>
91+
test user
92+
</span>
8993
</div>
9094
</div>
9195
</div>

test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastPlaybackBody-test.tsx.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ exports[`VoiceBroadcastPlaybackBody when rendering a broadcast should render as
3131
role="presentation"
3232
style="mask-image: url(\\"image-file-stub\\");"
3333
/>
34-
@user:example.com
34+
<span>
35+
@user:example.com
36+
</span>
3537
</div>
3638
<div
3739
class="mx_VoiceBroadcastHeader_line"
@@ -109,7 +111,9 @@ exports[`VoiceBroadcastPlaybackBody when rendering a buffering voice broadcast s
109111
role="presentation"
110112
style="mask-image: url(\\"image-file-stub\\");"
111113
/>
112-
@user:example.com
114+
<span>
115+
@user:example.com
116+
</span>
113117
</div>
114118
<div
115119
class="mx_VoiceBroadcastHeader_line"

test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastRecordingBody-test.tsx.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ exports[`VoiceBroadcastRecordingBody when rendering a live broadcast should rend
3131
role="presentation"
3232
style="mask-image: url(\\"image-file-stub\\");"
3333
/>
34-
@user:example.com
34+
<span>
35+
@user:example.com
36+
</span>
3537
</div>
3638
</div>
3739
<div

test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastRecordingPip-test.tsx.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ exports[`VoiceBroadcastRecordingPip when rendering should create the expected re
3131
role="presentation"
3232
style="mask-image: url(\\"image-file-stub\\");"
3333
/>
34-
@user:example.com
34+
<span>
35+
@user:example.com
36+
</span>
3537
</div>
3638
</div>
3739
<div

0 commit comments

Comments
 (0)