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

Commit 18f501b

Browse files
committed
Align RoomSummaryCard styles with Figma
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 4d77209 commit 18f501b

File tree

12 files changed

+136
-105
lines changed

12 files changed

+136
-105
lines changed

playwright/e2e/polls/pollHistory.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test.describe("Poll history", () => {
6969
async function openPollHistory(app: ElementAppPage): Promise<void> {
7070
const { page } = app;
7171
await app.toggleRoomInfoPanel();
72-
await page.locator(".mx_RoomSummaryCard").getByRole("menuitem", { name: "Poll history" }).click();
72+
await page.locator(".mx_RoomSummaryCard").getByRole("menuitem", { name: "Polls" }).click();
7373
}
7474

7575
test.use({
Loading
Loading

res/css/views/right_panel/_RoomSummaryCard.pcss

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ limitations under the License.
1515
*/
1616

1717
.mx_RoomSummaryCard {
18+
--cpd-separator-inset: var(--cpd-space-4x);
19+
--cpd-separator-spacing: var(--cpd-space-4x);
20+
1821
.mx_RoomSummaryCard_container {
1922
text-align: center;
2023
margin: $spacing-20 var(--cpd-space-4x) 0;

src/components/views/right_panel/RoomSummaryCard.tsx

+18-8
Original file line numberDiff line numberDiff line change
@@ -575,18 +575,11 @@ const RoomSummaryCard: React.FC<IProps> = ({
575575
disabled={!canInviteToState}
576576
onSelect={() => inviteToRoom(room)}
577577
/>
578-
<MenuItem Icon={LinkIcon} label={_t("action|copy_link")} onSelect={onShareRoomClick} />
579-
<MenuItem Icon={SettingsIcon} label={_t("common|settings")} onSelect={onRoomSettingsClick} />
580578

581579
<Separator />
580+
582581
{!isVideoRoom && (
583582
<>
584-
<MenuItem Icon={FilesIcon} label={_t("right_panel|files_button")} onSelect={onRoomFilesClick} />
585-
<MenuItem
586-
Icon={PollsIcon}
587-
label={_t("right_panel|polls_button")}
588-
onSelect={onRoomPollHistoryClick}
589-
/>
590583
{pinningEnabled && (
591584
<MenuItem
592585
Icon={PinIcon}
@@ -598,6 +591,21 @@ const RoomSummaryCard: React.FC<IProps> = ({
598591
</Text>
599592
</MenuItem>
600593
)}
594+
<MenuItem Icon={FilesIcon} label={_t("right_panel|files_button")} onSelect={onRoomFilesClick} />
595+
</>
596+
)}
597+
598+
<Separator />
599+
600+
<MenuItem Icon={LinkIcon} label={_t("action|copy_link")} onSelect={onShareRoomClick} />
601+
602+
{!isVideoRoom && (
603+
<>
604+
<MenuItem
605+
Icon={PollsIcon}
606+
label={_t("right_panel|polls_button")}
607+
onSelect={onRoomPollHistoryClick}
608+
/>
601609
<MenuItem
602610
Icon={ExportArchiveIcon}
603611
label={_t("export_chat|title")}
@@ -606,6 +614,8 @@ const RoomSummaryCard: React.FC<IProps> = ({
606614
</>
607615
)}
608616

617+
<MenuItem Icon={SettingsIcon} label={_t("common|settings")} onSelect={onRoomSettingsClick} />
618+
609619
<Separator />
610620

611621
<MenuItem

src/i18n/strings/en_EN.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,7 @@
18441844
},
18451845
"title": "Pinned messages"
18461846
},
1847-
"pinned_messages_button": "Pinned",
1847+
"pinned_messages_button": "Pinned messages",
18481848
"poll": {
18491849
"active_heading": "Active polls",
18501850
"empty_active": "There are no active polls in this room",
@@ -1869,7 +1869,7 @@
18691869
"view_in_timeline": "View poll in timeline",
18701870
"view_poll": "View poll"
18711871
},
1872-
"polls_button": "Poll history",
1872+
"polls_button": "Polls",
18731873
"room_summary_card": {
18741874
"title": "Room info"
18751875
},

test/components/views/dialogs/RoomSettingsDialog-test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe("<RoomSettingsDialog />", () => {
183183
it("displays poll history when tab clicked", () => {
184184
const { container } = getComponent();
185185

186-
fireEvent.click(screen.getByText("Poll history"));
186+
fireEvent.click(screen.getByText("Polls"));
187187

188188
expect(container.querySelector(".mx_SettingsTab")).toMatchSnapshot();
189189
});

test/components/views/dialogs/__snapshots__/RoomSettingsDialog-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ NodeList [
8989
class="mx_TabbedView_tabLabel_text"
9090
id="mx_tabpanel_ROOM_POLL_HISTORY_TAB_label"
9191
>
92-
Poll history
92+
Polls
9393
</span>
9494
</li>,
9595
]
@@ -105,7 +105,7 @@ exports[`<RoomSettingsDialog /> poll history displays poll history when tab clic
105105
<h2
106106
class="mx_Heading_h2 mx_PollHistory_header"
107107
>
108-
Poll history
108+
Polls
109109
</h2>
110110
<div
111111
class="mx_PollHistoryList"

test/components/views/polls/pollHistory/PollHistory-test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ describe("<PollHistory />", () => {
320320

321321
fireEvent.click(getByText("Question?"));
322322

323-
expect(queryByText("Poll history")).not.toBeInTheDocument();
323+
expect(queryByText("Polls")).not.toBeInTheDocument();
324324
// elements from MPollBody
325325
expect(getByText("Question?")).toMatchSnapshot();
326326
expect(getByText("Socks")).toBeInTheDocument();
@@ -396,13 +396,13 @@ describe("<PollHistory />", () => {
396396
expect(getByText("Question?")).toBeInTheDocument();
397397

398398
// header not shown
399-
expect(queryByText("Poll history")).not.toBeInTheDocument();
399+
expect(queryByText("Polls")).not.toBeInTheDocument();
400400

401401
expect(getByText("Active polls")).toMatchSnapshot();
402402
fireEvent.click(getByText("Active polls"));
403403

404404
// main list header displayed again
405-
expect(getByText("Poll history")).toBeInTheDocument();
405+
expect(getByText("Polls")).toBeInTheDocument();
406406
// active filter still active
407407
expect(getByTestId("filter-tab-PollHistory_filter-ACTIVE").firstElementChild).toBeChecked();
408408
// list displayed

test/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exports[`<PollHistory /> renders a list of active polls when there are polls in
3737
<h2
3838
class="mx_Heading_h2 mx_PollHistory_header"
3939
>
40-
Poll history
40+
Polls
4141
</h2>
4242
<div
4343
class="mx_PollHistoryList"

test/components/views/right_panel/RoomSummaryCard-test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,22 @@ describe("<RoomSummaryCard />", () => {
272272
mocked(settingsHooks.useFeatureEnabled).mockImplementation((feature) => feature === "feature_pinning");
273273
const { getByText } = getComponent();
274274

275-
expect(getByText("Pinned")).toBeInTheDocument();
275+
expect(getByText("Pinned messages")).toBeInTheDocument();
276276
});
277277
});
278278

279279
describe("poll history", () => {
280280
it("renders poll history option", () => {
281281
const { getByText } = getComponent();
282282

283-
expect(getByText("Poll history")).toBeInTheDocument();
283+
expect(getByText("Polls")).toBeInTheDocument();
284284
});
285285

286286
it("opens poll history dialog on button click", () => {
287287
const permalinkCreator = new RoomPermalinkCreator(room);
288288
const { getByText } = getComponent({ permalinkCreator });
289289

290-
fireEvent.click(getByText("Poll history"));
290+
fireEvent.click(getByText("Polls"));
291291

292292
expect(Modal.createDialog).toHaveBeenCalledWith(PollHistoryDialog, {
293293
room,

0 commit comments

Comments
 (0)