Skip to content

Commit

Permalink
fix: Use helper function to get order class
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed May 3, 2024
1 parent a5a975a commit d7c8d91
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/features/swap/components/SwapOrderConfirmationView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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()

Expand Down

0 comments on commit d7c8d91

Please sign in to comment.