diff --git a/res/css/views/messages/_MPollBody.pcss b/res/css/views/messages/_MPollBody.pcss index 9889bb81bb..09160c083a 100644 --- a/res/css/views/messages/_MPollBody.pcss +++ b/res/css/views/messages/_MPollBody.pcss @@ -8,13 +8,18 @@ Please see LICENSE files in the repository root for full details. .mx_MPollBody { margin-top: 8px; + min-width: 0; /* Override fieldset default min-width: min-content */ + width: 100%; /* Ensure fieldset takes full available width */ + border: none; /* Remove default fieldset border */ + padding: 0; /* Remove default fieldset padding */ - h2 { + legend { font-weight: var(--cpd-font-weight-semibold); font-size: $font-15px; line-height: $font-24px; margin-top: 0; margin-bottom: 8px; + letter-spacing: var(--cpd-font-letter-spacing-heading-lg); .mx_MPollBody_edited { color: $roomtopic-color; @@ -23,7 +28,7 @@ Please see LICENSE files in the repository root for full details. } } - h2::before { + legend::before { content: ""; position: relative; display: inline-block; diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index 73fb82083a..15f2efce4b 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -325,11 +325,11 @@ export default class MPollBody extends React.Component { ) : null; return ( -
-

+
+ {pollEvent.question.text} {editedSpan} -

+
{pollEvent.answers.map((answer: PollAnswerSubevent) => { let answerVotes = 0; @@ -360,7 +360,7 @@ export default class MPollBody extends React.Component { {totalText} {isFetchingResponses && }
-
+ ); } } diff --git a/test/unit-tests/components/views/messages/__snapshots__/MPollBody-test.tsx.snap b/test/unit-tests/components/views/messages/__snapshots__/MPollBody-test.tsx.snap index d6727168c3..a4be1cca24 100644 --- a/test/unit-tests/components/views/messages/__snapshots__/MPollBody-test.tsx.snap +++ b/test/unit-tests/components/views/messages/__snapshots__/MPollBody-test.tsx.snap @@ -1,15 +1,15 @@ -// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`MPollBody renders a finished poll 1`] = `
-
-

What should we order for the party? -

+
@@ -151,20 +151,20 @@ exports[`MPollBody renders a finished poll 1`] = ` > Final result based on 3 votes
-
+
`; exports[`MPollBody renders a finished poll with multiple winners 1`] = `
-
-

What should we order for the party? -

+
@@ -309,20 +309,20 @@ exports[`MPollBody renders a finished poll with multiple winners 1`] = ` > Final result based on 4 votes
-
+
`; exports[`MPollBody renders a finished poll with no votes 1`] = `
-
-

What should we order for the party? -

+
@@ -461,20 +461,20 @@ exports[`MPollBody renders a finished poll with no votes 1`] = ` > Final result based on 0 votes
-
+
`; exports[`MPollBody renders a poll that I have not voted in 1`] = `
-
-

What should we order for the party? -

+
@@ -661,20 +661,20 @@ exports[`MPollBody renders a poll that I have not voted in 1`] = ` > 3 votes cast. Vote to see the results
-
+
`; exports[`MPollBody renders a poll with local, non-local and invalid votes 1`] = `
-
-

What should we order for the party? -

+
@@ -869,20 +869,20 @@ exports[`MPollBody renders a poll with local, non-local and invalid votes 1`] = > Based on 5 votes
-
+
`; exports[`MPollBody renders a poll with no votes 1`] = `
-
-

What should we order for the party? -

+
@@ -1069,20 +1069,20 @@ exports[`MPollBody renders a poll with no votes 1`] = ` > No votes cast
-
+
`; exports[`MPollBody renders a poll with only non-local votes 1`] = `
-
-

What should we order for the party? -

+
@@ -1277,20 +1277,20 @@ exports[`MPollBody renders a poll with only non-local votes 1`] = ` > Based on 3 votes
-
+
`; exports[`MPollBody renders an undisclosed, finished poll 1`] = `
-
-

What should we order for the party? -

+
@@ -1435,20 +1435,20 @@ exports[`MPollBody renders an undisclosed, finished poll 1`] = ` > Final result based on 4 votes
-
+
`; exports[`MPollBody renders an undisclosed, unfinished poll 1`] = `
-
-

What should we order for the party? -

+
@@ -1635,6 +1635,6 @@ exports[`MPollBody renders an undisclosed, unfinished poll 1`] = ` > Results will be visible when the poll is ended
-
+
`; diff --git a/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap b/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap index ac2603d89d..866e7bbb81 100644 --- a/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap +++ b/test/unit-tests/components/views/messages/__snapshots__/MPollEndBody-test.tsx.snap @@ -18,14 +18,14 @@ exports[` when poll start event exists in current timeline rende > Ended a poll -
-

Question? -

+
@@ -111,7 +111,7 @@ exports[` when poll start event exists in current timeline rende />
- + `; diff --git a/test/unit-tests/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap b/test/unit-tests/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap index 267f197c35..9fbb3f15d8 100644 --- a/test/unit-tests/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap +++ b/test/unit-tests/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap @@ -1,19 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` Poll detail displays poll detail on active poll list item click 1`] = ` -

Question? -

+ `; exports[` Poll detail displays poll detail on past poll list item click 1`] = ` -

What? -

+ `; exports[` Poll detail navigates back to poll list from detail view on header click 1`] = `