Skip to content

Commit

Permalink
mB redesign poll
Browse files Browse the repository at this point in the history
  • Loading branch information
hom3mad3 authored and goapunk committed Jun 24, 2024
1 parent 811c326 commit 1ef70bd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion adhocracy4/polls/static/PollDetail/PollOpenQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const PollOpenQuestion = (props) => {
}

return (
<div className="poll">
<div className="poll poll--question">
<h2>{props.question.label}</h2>
{questionHelpText}
<div className="poll__rows">
Expand Down
2 changes: 1 addition & 1 deletion adhocracy4/polls/static/PollDetail/PollQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const PollQuestion = (props) => {

return (
<form>
<div className="poll">
<div className="poll poll--question">
<h2>{props.question.label}</h2>
{questionHelpText}
{multiHelpText}
Expand Down
6 changes: 3 additions & 3 deletions adhocracy4/polls/static/PollDetail/PollResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export default class PollResult extends React.Component {
getOtherAnswerText () {
let otherAnswerText
if (this.state.showOtherAnswers) {
otherAnswerText = <span>{django.gettext('Hide other answers')}</span>
otherAnswerText = <>{django.gettext('Hide other answers')}</>
} else {
otherAnswerText = <span>{django.gettext('Show other answers')}</span>
otherAnswerText = <>{django.gettext('Show other answers')}</>
}
return (
otherAnswerText
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class PollResult extends React.Component {
}

return (
<div className="poll">
<div className="poll poll--result">
<h2>{this.state.question.label}</h2>
<div className="poll__rows">
{this.state.question.choices.map((choice, i) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`render <PollQuestion> with... -> multiple-choice -> non-open-asnwers 1`
<div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -62,7 +62,7 @@ exports[`render <PollQuestion> with... -> multiple-choice -> non-open-asnwers 1`
"container": <div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -174,7 +174,7 @@ exports[`render <PollQuestion> with... -> multiple-choice -> open-asnwers 1`] =
<div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -229,7 +229,7 @@ exports[`render <PollQuestion> with... -> multiple-choice -> open-asnwers 1`] =
"container": <div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -341,7 +341,7 @@ exports[`render <PollQuestion> with... -> single-choice -> non-open-asnwers 1`]
<div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -391,7 +391,7 @@ exports[`render <PollQuestion> with... -> single-choice -> non-open-asnwers 1`]
"container": <div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -498,7 +498,7 @@ exports[`render <PollQuestion> with... -> single-choice -> open-asnwers 1`] = `
<div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down Expand Up @@ -548,7 +548,7 @@ exports[`render <PollQuestion> with... -> single-choice -> open-asnwers 1`] = `
"container": <div>
<form>
<div
class="poll"
class="poll poll--question"
>
<h2>
My Question
Expand Down
4 changes: 4 additions & 0 deletions changelog/_8186.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Changed

- added new modifier classes to `PollResults.jsx`, `PollOpenQuestion.jsx` and `PollQuestion.jsx` for customized paddings
- replaced `<span></span>` with react fragment to keep consistency

0 comments on commit 1ef70bd

Please sign in to comment.