From 44fd2370373d1cb934825701615e664f084d9107 Mon Sep 17 00:00:00 2001
From: meenakshi-deriv <104189801+meenakshi-deriv@users.noreply.github.com>
Date: Thu, 8 Aug 2024 16:38:11 +0400
Subject: [PATCH] Meenu/fix: fixed audit page (#779)
* fix: fixed audit page
* fix: refactor
* fix: refcactor purchase function
* fix: refactor function
* fix: refactor purchase function
* fix: rename func
---
.../pages/trade/purchase/contract-details.jsx | 44 ++++++++++++-------
.../app/pages/trade/purchase/purchase.jsx | 2 +
2 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/src/javascript/app/pages/trade/purchase/contract-details.jsx b/src/javascript/app/pages/trade/purchase/contract-details.jsx
index 8041f6db164..2207515a2bf 100644
--- a/src/javascript/app/pages/trade/purchase/contract-details.jsx
+++ b/src/javascript/app/pages/trade/purchase/contract-details.jsx
@@ -1,6 +1,6 @@
/* eslint-disable import/no-unresolved */
import React, { useEffect, useState } from 'react';
-import { Button, Skeleton, Text } from '@deriv-com/quill-ui';
+import { Button, Skeleton, Text } from '@deriv-com/quill-ui';
import { LabelPairedArrowLeftMdRegularIcon } from '@deriv/quill-icons/LabelPaired';
import ContractTable from './contract-table';
import Portal from '../../portal';
@@ -10,6 +10,26 @@ import { localize } from '../../../../_common/localize';
import { Explanation } from '../../bottom/explanation';
import { TimeTooltipWrapper, triggerClick } from '../../../common/helpers';
+const resetPopupData = (isAuditReset = false) => {
+ const audit_reset_object = {
+ cd_showAudit: false,
+ auditDataEnd: [],
+ cd_infoMsg : null,
+ };
+
+ const contract_reset_object = {
+ ...audit_reset_object,
+ showContractDetailsPopup: false,
+ cd_showSell : false,
+ cd_contractEnded : false,
+ cd_showAuditBtn : false,
+ };
+
+ dataManager.setPurchase({
+ ...(isAuditReset ? { ...audit_reset_object } : contract_reset_object),
+ });
+};
+
const AuditSection = ({ data }) => {
const auditData = {
start: {
@@ -35,9 +55,7 @@ const AuditSection = ({ data }) => {
icon={