Skip to content

Commit

Permalink
[Upd #52] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope committed Feb 1, 2022
1 parent 9686a55 commit 016daa4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Question.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,26 @@ export default class Question extends React.Component {
const question = this.props.question;
const subQuestion = question[Constants.HAS_SUBQUESTION];
const options = this.context.options;
const renderQuestion = this.questionComponent(question);
const questionComponent = this.renderQuestion(question);
if (FormUtils.isHidden(question)) {
return null;
}
if (!FormUtils.isRelevant(question) &&
(this.context.options.debugMode || JsonLdObjectUtils.checkId(subQuestion, options.startingQuestionId))) {
return (
<div className="show-irrelevant">
{renderQuestion}
{questionComponent}
</div>
);
}
if (!FormUtils.isRelevant(question)) {
return null;
}

return renderQuestion;
return questionComponent;
}

questionComponent(question) {
renderQuestion(question) {
if (FormUtils.isAnswerable(question) && !FormUtils.isSection(question)) {
if (PRETTY_ANSWERABLE_LAYOUT) {
return (
Expand Down

0 comments on commit 016daa4

Please sign in to comment.