mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-05-18 15:09:51 +00:00
chore(amm-ui): add SlippageToleranceControl
This commit is contained in:
parent
476087a36b
commit
6eed55d7e4
@ -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
|
||||
|
||||
@ -98,6 +98,7 @@ Item {
|
||||
|
||||
Item {
|
||||
implicitHeight: 18
|
||||
visible: root.slippageText.length > 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user