Skip to content

Commit

Permalink
chore: renamed p2p_order_info variable with p2pOrderInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
ameerul-deriv committed Jun 10, 2024
1 parent 7af2983 commit e25dacb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
const {
isBuyOrderForUser,
isCompletedOrder,
p2p_order_info,
p2p_order_info: p2pOrderInfo,
shouldShowCancelAndPaidButton,
shouldShowComplainAndReceivedButton,
shouldShowOnlyComplainButton,
Expand All @@ -45,7 +45,7 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }

const handleModalDisplay = (code?: string) => {
if (isError) {
if (code === ERROR_CODES.ORDER_EMAIL_VERIFICATION_REQUIRED && p2p_order_info?.verification_next_request) {
if (code === ERROR_CODES.ORDER_EMAIL_VERIFICATION_REQUIRED && p2pOrderInfo?.verification_next_request) {
showModal('EmailVerificationModal');
} else if (
code === ERROR_CODES.INVALID_VERIFICATION_TOKEN ||
Expand Down Expand Up @@ -112,9 +112,9 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
isBuyOrderForUser,
isError,
isSuccess,
p2p_order_info?.verification_next_request,
p2pOrderInfo?.verification_next_request,
data?.is_dry_run_successful,
orderDetails?.p2p_order_info?.status,
p2pOrderInfo?.status,
]);

// TODO: Uncomment this block when implementing email link has expired modal
Expand Down Expand Up @@ -231,7 +231,7 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
{!!isModalOpenFor('EmailVerificationModal') && (
<EmailVerificationModal
isModalOpen
nextRequestTime={p2p_order_info!.verification_next_request!}
nextRequestTime={p2pOrderInfo!.verification_next_request!}
onRequestClose={hideModal}
onResendEmail={() => mutate({ id })}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const OrderDetailsCardHeader = () => {
isBuyerConfirmedOrder,
isPendingOrder,
orderExpiryMilliseconds,
p2p_order_info,
p2p_order_info: p2pOrderInfo,
shouldHighlightAlert,
shouldHighlightDanger,
shouldHighlightSuccess,
Expand All @@ -41,11 +41,11 @@ const OrderDetailsCardHeader = () => {
</Text>
{!hasTimerExpired && (isPendingOrder || isBuyerConfirmedOrder) && (
<Text size={isMobile ? '2xl' : 'xl'}>
{displayPaymentAmount} {p2p_order_info?.local_currency}
{displayPaymentAmount} {p2pOrderInfo?.local_currency}
</Text>
)}
<Text color='less-prominent' size={textSize}>
<Localize i18n_default_text='Order ID {{id}}' values={{ id: p2p_order_info?.id }} />
<Localize i18n_default_text='Order ID {{id}}' values={{ id: p2pOrderInfo?.id }} />
</Text>
</div>
{shouldShowOrderTimer && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { ActiveOrderInfo } from './ActiveOrderInfo';

const OrderDetailsCardInfo = () => {
const { orderDetails } = useOrderDetails();
const { displayPaymentAmount, labels, otherUserDetails, p2p_order_info, purchaseTime, rateAmount } = orderDetails;
const {
displayPaymentAmount,
labels,
otherUserDetails,
p2p_order_info: p2pOrderInfo,
purchaseTime,
rateAmount,
} = orderDetails;
const { isMobile } = useDevice();

const clientDetails = [
Expand All @@ -13,14 +20,14 @@ const OrderDetailsCardInfo = () => {
text: labels.counterpartyRealNameLabel,
value: `${otherUserDetails.first_name} ${otherUserDetails.last_name}`,
},
{ text: labels.leftSendOrReceive, value: `${displayPaymentAmount} ${p2p_order_info?.local_currency}` },
{ text: labels.leftSendOrReceive, value: `${displayPaymentAmount} ${p2pOrderInfo?.local_currency}` },
{
text: labels.rightSendOrReceive,
value: `${p2p_order_info?.amount_display} ${p2p_order_info?.account_currency}`,
value: `${p2pOrderInfo?.amount_display} ${p2pOrderInfo?.account_currency}`,
},
{
text: `Rate (1 ${p2p_order_info?.account_currency})`,
value: `${rateAmount} ${p2p_order_info?.local_currency}`,
text: `Rate (1 ${p2pOrderInfo?.account_currency})`,
value: `${rateAmount} ${p2pOrderInfo?.local_currency}`,
},
{ text: 'Time', value: purchaseTime },
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const OrderDetailsCardReview = ({ setShowRatingModal, showRatingModal }: TOrderD
is_reviewable: isReviewable,
isBuyOrderForUser,
isCompletedOrder,
p2p_order_info,
p2p_order_info: p2pOrderInfo,
review_details: reviewDetails,
} = orderDetails;
const { data: p2pSettingsData } = api.settings.useSettings();
Expand All @@ -39,10 +39,10 @@ const OrderDetailsCardReview = ({ setShowRatingModal, showRatingModal }: TOrderD
}, [showModal, showRatingModal]);

useEffect(() => {
if (p2p_order_info?.completion_time && p2pSettingsData?.review_period) {
setRemainingReviewTime(getDateAfterHours(p2p_order_info?.completion_time, p2pSettingsData.review_period));
if (p2pOrderInfo?.completion_time && p2pSettingsData?.review_period) {
setRemainingReviewTime(getDateAfterHours(p2pOrderInfo?.completion_time, p2pSettingsData.review_period));
}
}, [p2p_order_info?.completion_time, p2pSettingsData?.review_period]);
}, [p2pOrderInfo?.completion_time, p2pSettingsData?.review_period]);

if (isCompletedOrder && !hasReviewDetails)
return (
Expand Down

0 comments on commit e25dacb

Please sign in to comment.