Skip to content

Commit

Permalink
Display the indicator even with one message in pinned message banner (#…
Browse files Browse the repository at this point in the history
…12946)

* Display the indicator even with one message

* Update e2e tests
  • Loading branch information
florianduros authored Sep 2, 2024
1 parent 41686bb commit f033b64
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions res/css/views/rooms/_PinnedMessageBanner.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
grid-area: title;
font: var(--cpd-font-body-sm-regular);
color: var(--cpd-color-text-action-accent);
height: 20px;
line-height: 20px;

.mx_PinnedMessageBanner_title_counter {
font: var(--cpd-font-body-sm-semibold);
Expand All @@ -90,7 +90,7 @@
.mx_PinnedMessageBanner_message {
grid-area: message;
font: var(--cpd-font-body-sm-regular);
height: 20px;
line-height: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand All @@ -114,6 +114,10 @@
height: 63px;

.mx_PinnedMessageBanner_content {
grid-template: "pinIcon message" auto;
grid-template: "indicators pinIcon message" auto;

.mx_PinnedMessageBanner_message {
line-height: 40px;
}
}
}
2 changes: 1 addition & 1 deletion src/components/views/rooms/PinnedMessageBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function PinnedMessageBanner({ room, permalinkCreator }: PinnedMessageBan
onClick={onBannerClick}
>
<div className="mx_PinnedMessageBanner_content">
{!isSinglePinnedEvent && <Indicators count={eventCount} currentIndex={currentEventIndex} />}
<Indicators count={eventCount} currentIndex={currentEventIndex} />
<PinIcon width="20" className="mx_PinnedMessageBanner_PinIcon" />
{!isSinglePinnedEvent && (
<div className="mx_PinnedMessageBanner_title" data-testid="banner-counter">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ exports[`<PinnedMessageBanner /> should render a single pinned event 1`] = `
<div
class="mx_PinnedMessageBanner_content"
>
<div
class="mx_PinnedMessageBanner_Indicators"
>
<div
class="mx_PinnedMessageBanner_Indicator mx_PinnedMessageBanner_Indicator--active"
data-testid="banner-indicator"
/>
</div>
<div
class="mx_PinnedMessageBanner_PinIcon"
width="20"
Expand Down

0 comments on commit f033b64

Please sign in to comment.