From 79ce54f2de7e3477e047376815b06065a2dd9b4f Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Fri, 8 May 2026 15:33:33 +0200 Subject: [PATCH] chore(amm-ui): add SlippageToleranceControl --- amm-ui/qml/SwapCard.qml | 14 +++++++++++++- amm-ui/qml/components/SwapSummary.qml | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/amm-ui/qml/SwapCard.qml b/amm-ui/qml/SwapCard.qml index 3ae4e52..2b62c48 100644 --- a/amm-ui/qml/SwapCard.qml +++ b/amm-ui/qml/SwapCard.qml @@ -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 diff --git a/amm-ui/qml/components/SwapSummary.qml b/amm-ui/qml/components/SwapSummary.qml index 4bc4750..6ca2285 100644 --- a/amm-ui/qml/components/SwapSummary.qml +++ b/amm-ui/qml/components/SwapSummary.qml @@ -98,6 +98,7 @@ Item { Item { implicitHeight: 18 + visible: root.slippageText.length > 0 Layout.fillWidth: true