Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/perfect-walls-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reservoir0x/relay-kit-ui': patch
---

Fix slippage ui bugs
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,18 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({

let breakdown: { title: string; value: ReactNode }[] = []

if (
minimumAmountFormatted &&
quote?.details?.slippageTolerance?.destination?.percent &&
quote.details.slippageTolerance.destination.percent != '0.00'
) {
const slippage = Number(
quote?.details?.slippageTolerance?.destination?.percent ??
quote?.details?.slippageTolerance?.origin?.percent ??
0
)

if (minimumAmountFormatted && slippage && slippage != 0) {
breakdown.push({
title: 'Min. Received',
value: (
<Flex
align="center"
align="end"
direction="column"
css={{
gap: '1'
Expand All @@ -151,7 +153,7 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
{quote?.details?.slippageTolerance?.destination?.percent ?? 0}
%
</Text>
<Flex css={{ color: 'gray9' }}>
<Flex css={{ color: 'gray8' }}>
<FontAwesomeIcon
icon={faInfoCircle}
width={14}
Expand All @@ -169,9 +171,8 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
})
}

breakdown = [
...breakdown,
{
if (timeEstimate.time) {
breakdown.push({
title: 'Estimated time',
value: (
<Flex
Expand All @@ -188,7 +189,11 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
<Text style="subtitle2">~ {timeEstimate?.formattedTime}</Text>
</Flex>
)
},
})
}

breakdown = [
...breakdown,
{
title: 'Network cost',
value: (
Expand Down
Loading