Skip to content

Commit

Permalink
Adds conditionals to complaint detail body component for company resp…
Browse files Browse the repository at this point in the history
…onse data
  • Loading branch information
Bill Whorton committed Sep 22, 2023
1 parent 28ba824 commit 0b176c4
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions src/components/ComplaintDetail/ComplaintDetailBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,30 @@ export const ComplaintDetailBody = ({ data, error, id }) => {
<br />
</div>
<div className="card-right layout-column">
<h4 tabIndex="0">Timely response?</h4>
<CompanyTimely value={data.timely} />
<br />
<h4 tabIndex="0">Company response to consumer</h4>
<span className="body-copy" tabIndex="0">
{data.company_response}
</span>
<br />
<h4 tabIndex="0">Company public response</h4>
<span className="body-copy" tabIndex="0">
{data.company_public_response}
</span>
{!!data.timely && (
<>
<h4 tabIndex="0">Timely response?</h4>
<CompanyTimely value={data.timely} />
<br />
</>
)}
{!!data.company_response && (
<>
<h4 tabIndex="0">Company response to consumer</h4>
<span className="body-copy" tabIndex="0">
{data.company_response}
</span>
<br />
</>
)}
{!!data.company_public_response && (
<>
<h4 tabIndex="0">Company public response</h4>
<span className="body-copy" tabIndex="0">
{data.company_public_response}
</span>
</>
)}
</div>
</div>
</article>
Expand Down

0 comments on commit 0b176c4

Please sign in to comment.