File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed
packages/ui/src/components/common/TransactionModal/steps Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @reservoir0x/relay-kit-ui ' : patch
3+ ---
4+
5+ Fix slippage ui bugs
Original file line number Diff line number Diff line change @@ -116,16 +116,18 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
116116
117117 let breakdown : { title : string ; value : ReactNode } [ ] = [ ]
118118
119- if (
120- minimumAmountFormatted &&
121- quote ?. details ?. slippageTolerance ?. destination ?. percent &&
122- quote . details . slippageTolerance . destination . percent != '0.00'
123- ) {
119+ const slippage = Number (
120+ quote ?. details ?. slippageTolerance ?. destination ?. percent ??
121+ quote ?. details ?. slippageTolerance ?. origin ?. percent ??
122+ 0
123+ )
124+
125+ if ( minimumAmountFormatted && slippage && slippage != 0 ) {
124126 breakdown . push ( {
125127 title : 'Min. Received' ,
126128 value : (
127129 < Flex
128- align = "center "
130+ align = "end "
129131 direction = "column"
130132 css = { {
131133 gap : '1'
@@ -151,7 +153,7 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
151153 { quote ?. details ?. slippageTolerance ?. destination ?. percent ?? 0 }
152154 %
153155 </ Text >
154- < Flex css = { { color : 'gray9 ' } } >
156+ < Flex css = { { color : 'gray8 ' } } >
155157 < FontAwesomeIcon
156158 icon = { faInfoCircle }
157159 width = { 14 }
@@ -169,9 +171,8 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
169171 } )
170172 }
171173
172- breakdown = [
173- ...breakdown ,
174- {
174+ if ( timeEstimate . time ) {
175+ breakdown . push ( {
175176 title : 'Estimated time' ,
176177 value : (
177178 < Flex
@@ -188,7 +189,11 @@ export const ReviewQuoteStep: FC<ReviewQuoteProps> = ({
188189 < Text style = "subtitle2" > ~ { timeEstimate ?. formattedTime } </ Text >
189190 </ Flex >
190191 )
191- } ,
192+ } )
193+ }
194+
195+ breakdown = [
196+ ...breakdown ,
192197 {
193198 title : 'Network cost' ,
194199 value : (
You can’t perform that action at this time.
0 commit comments