Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(swap): remove price impact warning from min received field #3066

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ export const TransactionSummary = () => {
label: strings.swapMinReceivedTitle,
value: (
<View style={styles.flex}>
{priceImpactRisk === 'high' && <Icon.Warning size={24} color={priceImpactRiskTextColor} />}

<Text style={[styles.text, {color: priceImpactRiskTextColor}, styles.alignRight]}>
{minReceivedInfoValue}
</Text>
<Text style={[styles.text, styles.alignRight]}>{minReceivedInfoValue}</Text>
</View>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {useSelectedWallet} from '../../../../../../SelectedWallet'
import {COLORS} from '../../../../../../theme'
import {useTokenInfo} from '../../../../../../yoroi-wallets/hooks'
import {Quantities} from '../../../../../../yoroi-wallets/utils'
import {getPriceImpactRisk, usePriceImpactRiskTheme} from '../../../../common/helpers'
import {useNavigateTo} from '../../../../common/navigation'
import {PoolIcon} from '../../../../common/PoolIcon/PoolIcon'
import {useStrings} from '../../../../common/strings'
Expand Down Expand Up @@ -176,11 +175,6 @@ const ShowMarketOrderFeeBreakdown = ({totalFees}: {totalFees: string}) => {
const sellTokenInfo = useTokenInfo({wallet, tokenId: amounts.sell.tokenId})
const buyTokenName = buyTokenInfo.ticker ?? buyTokenInfo.name
const sellTokenName = sellTokenInfo.ticker ?? sellTokenInfo.name
const priceImpact = calculation?.prices.priceImpact

const priceImpactRisk = getPriceImpactRisk(Number(priceImpact))
const priceImpactRiskTheme = usePriceImpactRiskTheme(priceImpactRisk)
const priceImpactRiskTextColor = priceImpactRiskTheme.text

// should not happen
if (!calculation) return <></>
Expand Down Expand Up @@ -211,7 +205,7 @@ const ShowMarketOrderFeeBreakdown = ({totalFees}: {totalFees: string}) => {
},
{
label: strings.swapMinReceivedTitle,
value: <Text style={[styles.text, {color: priceImpactRiskTextColor}]}>{minReceivedFormatted}</Text>,
value: minReceivedFormatted,
info: strings.swapMinReceived,
},
{
Expand Down
Loading