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

Commit 2c1c3ce

Browse files
committed
Align RoomSummaryCard styles with Figma
Signed-off-by: Michael Telatynski <[email protected]>
1 parent bf9ab96 commit 2c1c3ce

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
@@ -378,18 +378,11 @@ const RoomSummaryCard: React.FC<IProps> = ({
378378
disabled={!canInviteToState}
379379
onSelect={() => inviteToRoom(room)}
380380
/>
381-
<MenuItem Icon={LinkIcon} label={_t("action|copy_link")} onSelect={onShareRoomClick} />
382-
<MenuItem Icon={SettingsIcon} label={_t("common|settings")} onSelect={onRoomSettingsClick} />
383381

384382
<Separator />
383+
385384
{!isVideoRoom && (
386385
<>
387-
<MenuItem Icon={FilesIcon} label={_t("right_panel|files_button")} onSelect={onRoomFilesClick} />
388-
<MenuItem
389-
Icon={PollsIcon}
390-
label={_t("right_panel|polls_button")}
391-
onSelect={onRoomPollHistoryClick}
392-
/>
393386
{pinningEnabled && (
394387
<MenuItem
395388
Icon={PinIcon}
@@ -401,6 +394,21 @@ const RoomSummaryCard: React.FC<IProps> = ({
401394
</Text>
402395
</MenuItem>
403396
)}
397+
<MenuItem Icon={FilesIcon} label={_t("right_panel|files_button")} onSelect={onRoomFilesClick} />
398+
</>
399+
)}
400+
401+
<Separator />
402+
403+
<MenuItem Icon={LinkIcon} label={_t("action|copy_link")} onSelect={onShareRoomClick} />
404+
405+
{!isVideoRoom && (
406+
<>
407+
<MenuItem
408+
Icon={PollsIcon}
409+
label={_t("right_panel|polls_button")}
410+
onSelect={onRoomPollHistoryClick}
411+
/>
404412
<MenuItem
405413
Icon={ExportArchiveIcon}
406414
label={_t("export_chat|title")}
@@ -409,6 +417,8 @@ const RoomSummaryCard: React.FC<IProps> = ({
409417
</>
410418
)}
411419

420+
<MenuItem Icon={SettingsIcon} label={_t("common|settings")} onSelect={onRoomSettingsClick} />
421+
412422
<Separator />
413423

414424
<MenuItem

src/i18n/strings/en_EN.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@
18461846
},
18471847
"title": "Pinned messages"
18481848
},
1849-
"pinned_messages_button": "Pinned",
1849+
"pinned_messages_button": "Pinned messages",
18501850
"poll": {
18511851
"active_heading": "Active polls",
18521852
"empty_active": "There are no active polls in this room",
@@ -1871,7 +1871,7 @@
18711871
"view_in_timeline": "View poll in timeline",
18721872
"view_poll": "View poll"
18731873
},
1874-
"polls_button": "Poll history",
1874+
"polls_button": "Polls",
18751875
"room_summary_card": {
18761876
"title": "Room info"
18771877
},

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)