Display the indicator even with one message in pinned message banner (#12946)

* Display the indicator even with one message

* Update e2e tests
This commit is contained in:
Florian Duros 2024-09-02 17:51:04 +02:00 committed by GitHub
parent 41686bba58
commit f033b64b53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -80,7 +80,7 @@
grid-area: title; grid-area: title;
font: var(--cpd-font-body-sm-regular); font: var(--cpd-font-body-sm-regular);
color: var(--cpd-color-text-action-accent); color: var(--cpd-color-text-action-accent);
height: 20px; line-height: 20px;
.mx_PinnedMessageBanner_title_counter { .mx_PinnedMessageBanner_title_counter {
font: var(--cpd-font-body-sm-semibold); font: var(--cpd-font-body-sm-semibold);
@ -90,7 +90,7 @@
.mx_PinnedMessageBanner_message { .mx_PinnedMessageBanner_message {
grid-area: message; grid-area: message;
font: var(--cpd-font-body-sm-regular); font: var(--cpd-font-body-sm-regular);
height: 20px; line-height: 20px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -114,6 +114,10 @@
height: 63px; height: 63px;
.mx_PinnedMessageBanner_content { .mx_PinnedMessageBanner_content {
grid-template: "pinIcon message" auto; grid-template: "indicators pinIcon message" auto;
.mx_PinnedMessageBanner_message {
line-height: 40px;
}
} }
} }

View file

@ -102,7 +102,7 @@ export function PinnedMessageBanner({ room, permalinkCreator }: PinnedMessageBan
onClick={onBannerClick} onClick={onBannerClick}
> >
<div className="mx_PinnedMessageBanner_content"> <div className="mx_PinnedMessageBanner_content">
{!isSinglePinnedEvent && <Indicators count={eventCount} currentIndex={currentEventIndex} />} <Indicators count={eventCount} currentIndex={currentEventIndex} />
<PinIcon width="20" className="mx_PinnedMessageBanner_PinIcon" /> <PinIcon width="20" className="mx_PinnedMessageBanner_PinIcon" />
{!isSinglePinnedEvent && ( {!isSinglePinnedEvent && (
<div className="mx_PinnedMessageBanner_title" data-testid="banner-counter"> <div className="mx_PinnedMessageBanner_title" data-testid="banner-counter">

View file

@ -219,6 +219,14 @@ exports[`<PinnedMessageBanner /> should render a single pinned event 1`] = `
<div <div
class="mx_PinnedMessageBanner_content" class="mx_PinnedMessageBanner_content"
> >
<div
class="mx_PinnedMessageBanner_Indicators"
>
<div
class="mx_PinnedMessageBanner_Indicator mx_PinnedMessageBanner_Indicator--active"
data-testid="banner-indicator"
/>
</div>
<div <div
class="mx_PinnedMessageBanner_PinIcon" class="mx_PinnedMessageBanner_PinIcon"
width="20" width="20"