Commit 912eb829 authored by eddie's avatar eddie Committed by GitHub

feat: setup widget integration update (#6045)

* feat: setup widget integration update

* feat: preview of widget token selector

* feat: upgrade widget again for token selector

* fix: add back legacy token selector

* fix: token

* fix: upgrade again

* fix: tooltip bug

* fix: for real

* fix: updates
parent 2ddf3fe6
...@@ -24,7 +24,6 @@ const BodyText = styled.div` ...@@ -24,7 +24,6 @@ const BodyText = styled.div`
font-size: 14px; font-size: 14px;
` `
const RootWrapper = styled.div` const RootWrapper = styled.div`
position: relative;
margin-top: 16px; margin-top: 16px;
` `
...@@ -101,7 +100,6 @@ const ContentWrapper = styled.div<{ chainId: NetworkAlertChains; darkMode: boole ...@@ -101,7 +100,6 @@ const ContentWrapper = styled.div<{ chainId: NetworkAlertChains; darkMode: boole
position: absolute; position: absolute;
transform: rotate(25deg) translate(-90px, -40px); transform: rotate(25deg) translate(-90px, -40px);
width: 300px; width: 300px;
z-index: -1;
} }
` `
const Header = styled.h2` const Header = styled.h2`
......
...@@ -9,6 +9,7 @@ import { Trade } from '@uniswap/router-sdk' ...@@ -9,6 +9,7 @@ import { Trade } from '@uniswap/router-sdk'
import { Currency, TradeType } from '@uniswap/sdk-core' import { Currency, TradeType } from '@uniswap/sdk-core'
import { import {
AddEthereumChainParameter, AddEthereumChainParameter,
DialogAnimationType,
EMPTY_TOKEN_LIST, EMPTY_TOKEN_LIST,
OnReviewSwapClick, OnReviewSwapClick,
SwapWidget, SwapWidget,
...@@ -161,32 +162,38 @@ export default function Widget({ ...@@ -161,32 +162,38 @@ export default function Widget({
return ( return (
<> <>
<SwapWidget <div style={{ zIndex: 1, position: 'relative' }}>
hideConnectionUI <SwapWidget
brandedFooter={false} hideConnectionUI
permit2={permit2Enabled} brandedFooter={false}
routerUrl={WIDGET_ROUTER_URL} permit2={permit2Enabled}
locale={locale} routerUrl={WIDGET_ROUTER_URL}
theme={theme} locale={locale}
width={width} theme={theme}
defaultChainId={chainId} width={width}
onConnectWalletClick={onConnectWalletClick} defaultChainId={chainId}
provider={provider} onConnectWalletClick={onConnectWalletClick}
onSwitchChain={onSwitchChain} provider={provider}
tokenList={EMPTY_TOKEN_LIST} // prevents loading the default token list, as we use our own token selector UI onSwitchChain={onSwitchChain}
{...inputs} tokenList={EMPTY_TOKEN_LIST} // prevents loading the default token list, as we use our own token selector UI
{...settings} {...inputs}
{...transactions} {...settings}
onExpandSwapDetails={onExpandSwapDetails} {...transactions}
onReviewSwapClick={onReviewSwapClick} onExpandSwapDetails={onExpandSwapDetails}
onSubmitSwapClick={onSubmitSwapClick} onReviewSwapClick={onReviewSwapClick}
onSwapApprove={onApproveToken} onSubmitSwapClick={onSubmitSwapClick}
onInitialSwapQuote={onInitialSwapQuote} onSwapApprove={onApproveToken}
onSwapPriceUpdateAck={onSwapPriceUpdateAck} onInitialSwapQuote={onInitialSwapQuote}
onError={(error, errorInfo) => { onSwapPriceUpdateAck={onSwapPriceUpdateAck}
sendAnalyticsEvent(SwapEventName.SWAP_ERROR, { error, errorInfo, ...trace }) dialogOptions={{
}} pageCentered: true,
/> animationType: DialogAnimationType.FADE,
}}
onError={(error, errorInfo) => {
sendAnalyticsEvent(SwapEventName.SWAP_ERROR, { error, errorInfo, ...trace })
}}
/>
</div>
{tokenSelector} {tokenSelector}
</> </>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment