Skip to content

Commit

Permalink
feat: add SmartTransactionsEnabledBanner to Swaps Quotes VIew
Browse files Browse the repository at this point in the history
  • Loading branch information
httpJunkie committed Jan 16, 2025
1 parent cad3fe3 commit 378cdcb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ import { selectGasFeeControllerEstimateType } from '../../../selectors/gasFeeCon
import { addSwapsTransaction } from '../../../util/swaps/swaps-transactions';
import { getTransaction1559GasFeeEstimates } from './utils/gas';
import { getGlobalEthQuery } from '../../../util/networks/global-network';
import SmartTransactionsEnabledBanner from '../../Views/confirmations/components/SmartTransactionsEnabledBanner/SmartTransactionsEnabledBanner';

const LOG_PREFIX = 'Swaps';
const POLLING_INTERVAL = 30000;
Expand Down Expand Up @@ -148,6 +149,11 @@ const createStyles = (colors) =>
marginVertical: 10,
width: '100%',
},
smartTransactionsBanner: {
paddingHorizontal: 20,
marginHorizontal: 16,
marginVertical: 10,
},
timerWrapper: {
backgroundColor: colors.background.alternative,
borderRadius: 20,
Expand Down Expand Up @@ -1788,7 +1794,9 @@ function SwapsQuotesView({
keyboardShouldPersistTaps="handled"
>
<View style={styles.topBar}>
<SmartTransactionsEnabledBanner />
{(!hasEnoughTokenBalance || !hasEnoughEthBalance) && (
<>
<View style={styles.alertBar}>
<Alert small type={AlertType.Info}>
<Text reset bold>
Expand All @@ -1810,12 +1818,16 @@ function SwapsQuotesView({
)}
</Alert>
</View>
</>
)}
{!!selectedQuote &&
hasEnoughTokenBalance &&
hasEnoughEthBalance &&
shouldDisplaySlippage && (
<View style={styles.alertBar}>
<View style={styles.smartTransactionsBanner}>
<SmartTransactionsEnabledBanner />
</View>
<ActionAlert
type={
selectedQuote.priceSlippage?.bucket === SLIPPAGE_BUCKETS.HIGH
Expand Down

0 comments on commit 378cdcb

Please sign in to comment.