Skip to content

Commit

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

Expand All @@ -37,6 +40,9 @@ const AuditSection = ({ data }) => {
onClick={() => {
dataManager.setPurchase({
cd_showAudit: false,
auditDataEnd: [],
cd_infoMsg : null,

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

if (content){
return (
<React.Fragment key={`audit-table-${title}-${adk}`}>
<div className='table-box'>
<div className={`table-box ${isVisible ? '' : 'hide-table'}`} >
<Text size='md' bold centered>
{title}
</Text>
</div>
<div className='table-container'>
<div className={`table-container ${isVisible ? '' : 'hide-table'}`}>
<div className='table-item'>
<div className='item-header' />
<div className='item-content'>
Expand Down Expand Up @@ -130,7 +136,14 @@ const DetailsSection = ({ data }) => (
onClick={() => {
dataManager.setPurchase({
showContractDetailsPopup: false,
cd_showSell : false,
cd_contractEnded : false,
cd_infoMsg : null,
cd_showAuditBtn : false,
auditDataEnd : [],

});

}}
/>
<div className='title-box'>
Expand Down Expand Up @@ -177,6 +190,12 @@ const ContractDetails = () => {
if (event.key === 'Escape') {
dataManager.setPurchase({
showContractDetailsPopup: false,
cd_showSell : false,
cd_contractEnded : false,
cd_infoMsg : null,
cd_showAuditBtn : false,
cd_showAudit : false,
auditDataEnd : [],
});
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/javascript/app/pages/trade/purchase/purchase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const Purchase = () => {
error : null,
cd_errorMsg : null,
cd_showAuditBtn : false,
cd_contractEnded : false,
auditDataEnd : [],
cd_infoMsg : null,
});

Expand Down
4 changes: 4 additions & 0 deletions src/sass/_common/reskin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ body {
}
}

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

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

0 comments on commit 1306d8c

Please sign in to comment.