Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
meenakshi-deriv committed Aug 8, 2024
1 parent 1306d8c commit 689d50a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
25 changes: 11 additions & 14 deletions src/javascript/app/pages/trade/purchase/contract-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ import { TimeTooltipWrapper, triggerClick } from '../../../common/helpers';
const AuditSection = ({ data }) => {
const auditData = {
start: {
title : localize('Contract starts'),
content : data?.auditDataStart,
isVisible: data?.auditDataStart?.length > 0,
title : localize('Contract starts'),
content: data?.auditDataStart,
},
end: {
title : localize('Contract ends'),
content : data?.auditDataEnd,
isVisible: data?.auditDataEnd?.length > 0,
title : localize('Contract ends'),
content: data?.auditDataEnd,
},
details: {
title : localize('Contract details'),
content : data?.auditDataDetails,
isVisible: data?.auditDataDetails?.length > 0,
title : localize('Contract details'),
content: data?.auditDataDetails,
},
};

Expand Down Expand Up @@ -63,17 +60,17 @@ const AuditSection = ({ data }) => {
<div className='details-column'>
<div className='contract-info-wrapper full'>
{Object.keys(auditData).map(adk =>{
const { title,content, isVisible } = auditData[adk];

if (content){
const { title, content } = auditData[adk];
if (content?.length) {
return (
<React.Fragment key={`audit-table-${title}-${adk}`}>
<div className={`table-box ${isVisible ? '' : 'hide-table'}`} >
<div className='table-box' >
<Text size='md' bold centered>
{title}
</Text>
</div>
<div className={`table-container ${isVisible ? '' : 'hide-table'}`}>
<div className='table-container'>
<div className='table-item'>
<div className='item-header' />
<div className='item-content'>
Expand Down
4 changes: 0 additions & 4 deletions src/sass/_common/reskin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ body {
}
}

.hide-table {
display: none !important;
}

.quill {
&-container {
&-centered {
Expand Down

0 comments on commit 689d50a

Please sign in to comment.