From d7c8d919baf4350ee2814d7335625498a831ca47 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Fri, 3 May 2024 10:32:12 +0200 Subject: [PATCH] fix: Use helper function to get order class --- .../SwapOrderConfirmationView/index.tsx | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/features/swap/components/SwapOrderConfirmationView/index.tsx b/src/features/swap/components/SwapOrderConfirmationView/index.tsx index 85f0993f60..ba42fd120c 100644 --- a/src/features/swap/components/SwapOrderConfirmationView/index.tsx +++ b/src/features/swap/components/SwapOrderConfirmationView/index.tsx @@ -7,7 +7,13 @@ import { compareAsc } from 'date-fns' import { Alert, Typography } from '@mui/material' import { formatAmount } from '@/utils/formatNumber' import { formatVisualAmount } from '@/utils/formatters' -import { getExecutionPrice, getLimitPrice, getSlippageInPercent, getSurplusPrice } from '@/features/swap/helpers/utils' +import { + getExecutionPrice, + getLimitPrice, + getOrderClass, + getSlippageInPercent, + getSurplusPrice, +} from '@/features/swap/helpers/utils' import type { CowSwapConfirmationView } from '@safe-global/safe-gateway-typescript-sdk' import SwapTokens from '@/features/swap/components/SwapTokens' import AlertIcon from '@/public/images/common/alert.svg' @@ -23,24 +29,13 @@ type SwapOrderProps = { export const SwapOrderConfirmationView = ({ order, settlementContract }: SwapOrderProps): ReactElement | null => { if (!order) return null - const { - uid, - owner, - kind, - validUntil, - status, - sellToken, - buyToken, - sellAmount, - buyAmount, - explorerUrl, - receiver, - orderClass, - } = order + const { uid, owner, kind, validUntil, status, sellToken, buyToken, sellAmount, buyAmount, explorerUrl, receiver } = + order const executionPrice = getExecutionPrice(order) const limitPrice = getLimitPrice(order) const surplusPrice = getSurplusPrice(order) + const orderClass = getOrderClass(order) const expires = new Date(validUntil * 1000) const now = new Date()