Skip to content

Commit

Permalink
fix: display recipient for orders with custom recipient (#3631)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmealy authored and compojoom committed May 2, 2024
1 parent ef93ae5 commit 1159559
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/features/swap/components/SwapOrder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ import { Typography } from '@mui/material'
import { formatAmount } from '@/utils/formatNumber'
import { formatVisualAmount } from '@/utils/formatters'
import { getExecutionPrice, getLimitPrice, getOrderClass, getSurplusPrice } from '@/features/swap/helpers/utils'
import EthHashInfo from '@/components/common/EthHashInfo'
import useSafeInfo from '@/hooks/useSafeInfo'

type SwapOrderProps = {
txData?: TransactionData
txInfo?: SwapOrderType
}

export const SellOrder = ({ order }: { order: SwapOrderType }) => {
const { uid, kind, validUntil, status, sellToken, buyToken, sellAmount, buyAmount, explorerUrl } = order
const { safeAddress } = useSafeInfo()
const { uid, kind, validUntil, status, sellToken, buyToken, sellAmount, buyAmount, explorerUrl, receiver } = order

const executionPrice = getExecutionPrice(order)
const limitPrice = getLimitPrice(order)
Expand Down Expand Up @@ -104,6 +107,13 @@ export const SellOrder = ({ order }: { order: SwapOrderType }) => {
<DataRow key="Status" title="Status">
<StatusLabel status={status} />
</DataRow>,
receiver && receiver !== safeAddress ? (
<DataRow key="Recipient" title="Recipient">
<EthHashInfo address={receiver} showAvatar={false} />
</DataRow>
) : (
<></>
),
]}
/>
)
Expand Down

0 comments on commit 1159559

Please sign in to comment.