Skip to content

Commit

Permalink
hotfix-task-display (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
  • Loading branch information
jdolkowski and Jan authored Jan 26, 2024
1 parent 55ec622 commit 1fba3ca
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/components/TaskPreviewCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ function TaskPreviewCell({
return formatter(itemIncomingData, jsonExt, formatterIndex);
};

const shouldDisplay = (value) => {
if (!value) return false;
return Object.keys(value).length !== 0;
};

return (
<>
{itemData && (
<p>
{formatter(itemData, jsonExt, formatterIndex) ?? HYPHEN}
</p>
{(shouldDisplay(itemData) || shouldDisplay(jsonExt)) && (
<p>
{formatter(itemData, jsonExt, formatterIndex) ?? HYPHEN}
</p>
)}
{incomingData && (
<p style={{ fontWeight: 'bold' }}>
{showHistorical(incomingData)}
</p>
{shouldDisplay(incomingData) && (
<p style={{ fontWeight: 'bold' }}>
{showHistorical(incomingData)}
</p>
)}
</>
);
Expand Down

0 comments on commit 1fba3ca

Please sign in to comment.