Skip to content

Commit

Permalink
chore: remove hyphen if answer description does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Dec 6, 2024
1 parent 8c2d861 commit 6e5113c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/components/DisputePreview/DisputeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRp
<small>Option {i + 1}:</small>
<label>
{answer.title}
{answer.description ? ` - ${answer.description}` : null}
{answer.description.trim() ? ` - ${answer.description}` : null}
</label>
</Answer>
))}
Expand Down
9 changes: 7 additions & 2 deletions web/src/components/Verdict/Answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,23 @@ interface IAnswer {
answer?: Answer;
currentRuling: number;
}

const AnswerDisplay: React.FC<IAnswer> = ({ answer, currentRuling }) => {
return (
<>
{answer ? (
<Container>
<AnswerTitle>{answer.title} -</AnswerTitle>
<AnswerDescription>{answer.description}</AnswerDescription>
<AnswerTitle>
{answer.title}
{answer.description.trim() ? " -" : null}
</AnswerTitle>
<AnswerDescription>{answer.description.trim()}</AnswerDescription>
</Container>
) : (
<Container>{currentRuling !== 0 ? <h3>Answer 0x{currentRuling}</h3> : <h3>Refuse to Arbitrate</h3>}</Container>
)}
</>
);
};

export default AnswerDisplay;

0 comments on commit 6e5113c

Please sign in to comment.