chore(amm-ui): add SlippageToleranceControl

This commit is contained in:
Andrea Franz 2026-05-08 15:33:33 +02:00
parent 476087a36b
commit 6eed55d7e4
2 changed files with 14 additions and 1 deletions

View File

@ -217,10 +217,22 @@ Rectangle {
feeText: swapState.formatTokenAmount(root.feeAmount, root.sellToken ? root.sellToken.symbol : "")
priceImpactText: swapState.formatPercent(root.priceImpactPercent)
priceImpactPercent: root.priceImpactPercent
slippageText: swapState.formatSlippagePercent(root.slippageTolerancePercent)
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 {
id: ctaBox
Layout.fillWidth: true

View File

@ -98,6 +98,7 @@ Item {
Item {
implicitHeight: 18
visible: root.slippageText.length > 0
Layout.fillWidth: true