mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-05-19 07:29:32 +00:00
chore(amm-ui): add SlippageToleranceControl
This commit is contained in:
parent
8acdc90924
commit
79ce54f2de
@ -217,10 +217,22 @@ Rectangle {
|
|||||||
feeText: swapState.formatTokenAmount(root.feeAmount, root.sellToken ? root.sellToken.symbol : "")
|
feeText: swapState.formatTokenAmount(root.feeAmount, root.sellToken ? root.sellToken.symbol : "")
|
||||||
priceImpactText: swapState.formatPercent(root.priceImpactPercent)
|
priceImpactText: swapState.formatPercent(root.priceImpactPercent)
|
||||||
priceImpactPercent: root.priceImpactPercent
|
priceImpactPercent: root.priceImpactPercent
|
||||||
slippageText: swapState.formatSlippagePercent(root.slippageTolerancePercent)
|
|
||||||
minReceivedText: swapState.formatTokenAmount(root.minReceivedAmount, root.buyToken ? root.buyToken.symbol : "")
|
minReceivedText: swapState.formatTokenAmount(root.minReceivedAmount, root.buyToken ? root.buyToken.symbol : "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SlippageToleranceControl {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 12
|
||||||
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
tolerancePercent: root.slippageTolerancePercent
|
||||||
|
visible: root.tokensSelected && root.hasAmount
|
||||||
|
|
||||||
|
onToleranceChangeRequested: function(tolerancePercent) {
|
||||||
|
root.slippageTolerancePercent = swapState.clampSlippagePercent(tolerancePercent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: ctaBox
|
id: ctaBox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@ -98,6 +98,7 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
implicitHeight: 18
|
implicitHeight: 18
|
||||||
|
visible: root.slippageText.length > 0
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user