build: upgrade widgets for permit2 (#5551)
* build: upgrade widgets for permit2 * feat: flag permit2 in widget
This commit is contained in:
parent
f41cbbb58f
commit
6480b947ef
@ -143,20 +143,20 @@
|
|||||||
"@uniswap/governance": "^1.0.2",
|
"@uniswap/governance": "^1.0.2",
|
||||||
"@uniswap/liquidity-staker": "^1.0.2",
|
"@uniswap/liquidity-staker": "^1.0.2",
|
||||||
"@uniswap/merkle-distributor": "1.0.1",
|
"@uniswap/merkle-distributor": "1.0.1",
|
||||||
"@uniswap/permit2-sdk": "^1.2.0",
|
"@uniswap/permit2-sdk": "1.2.0",
|
||||||
"@uniswap/redux-multicall": "^1.1.8",
|
"@uniswap/redux-multicall": "^1.1.8",
|
||||||
"@uniswap/router-sdk": "^1.3.0",
|
"@uniswap/router-sdk": "^1.3.0",
|
||||||
"@uniswap/sdk-core": "^3.0.1",
|
"@uniswap/sdk-core": "^3.0.1",
|
||||||
"@uniswap/smart-order-router": "^2.10.0",
|
"@uniswap/smart-order-router": "^2.10.0",
|
||||||
"@uniswap/token-lists": "^1.0.0-beta.30",
|
"@uniswap/token-lists": "^1.0.0-beta.30",
|
||||||
"@uniswap/universal-router-sdk": "^1.2.1",
|
"@uniswap/universal-router-sdk": "1.2.1",
|
||||||
"@uniswap/v2-core": "1.0.0",
|
"@uniswap/v2-core": "1.0.0",
|
||||||
"@uniswap/v2-periphery": "^1.1.0-beta.0",
|
"@uniswap/v2-periphery": "^1.1.0-beta.0",
|
||||||
"@uniswap/v2-sdk": "^3.0.1",
|
"@uniswap/v2-sdk": "^3.0.1",
|
||||||
"@uniswap/v3-core": "1.0.0",
|
"@uniswap/v3-core": "1.0.0",
|
||||||
"@uniswap/v3-periphery": "^1.1.1",
|
"@uniswap/v3-periphery": "^1.1.1",
|
||||||
"@uniswap/v3-sdk": "^3.9.0",
|
"@uniswap/v3-sdk": "^3.9.0",
|
||||||
"@uniswap/widgets": "2.20.0",
|
"@uniswap/widgets": "2.22.0",
|
||||||
"@vanilla-extract/css": "^1.7.2",
|
"@vanilla-extract/css": "^1.7.2",
|
||||||
"@vanilla-extract/css-utils": "^0.1.2",
|
"@vanilla-extract/css-utils": "^0.1.2",
|
||||||
"@vanilla-extract/dynamic": "^2.0.2",
|
"@vanilla-extract/dynamic": "^2.0.2",
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
SwapWidgetSkeleton,
|
SwapWidgetSkeleton,
|
||||||
} from '@uniswap/widgets'
|
} from '@uniswap/widgets'
|
||||||
import { useWeb3React } from '@web3-react/core'
|
import { useWeb3React } from '@web3-react/core'
|
||||||
|
import { Permit2Variant, usePermit2Flag } from 'featureFlags/flags/permit2'
|
||||||
import { useActiveLocale } from 'hooks/useActiveLocale'
|
import { useActiveLocale } from 'hooks/useActiveLocale'
|
||||||
import {
|
import {
|
||||||
formatPercentInBasisPointsNumber,
|
formatPercentInBasisPointsNumber,
|
||||||
@ -131,6 +132,8 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
|
|||||||
[initialQuoteDate, trace]
|
[initialQuoteDate, trace]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const permit2Enabled = usePermit2Flag() === Permit2Variant.Enabled
|
||||||
|
|
||||||
if (!(inputs.value.INPUT || inputs.value.OUTPUT)) {
|
if (!(inputs.value.INPUT || inputs.value.OUTPUT)) {
|
||||||
return <WidgetSkeleton />
|
return <WidgetSkeleton />
|
||||||
}
|
}
|
||||||
@ -138,8 +141,9 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SwapWidget
|
<SwapWidget
|
||||||
disableBranding
|
|
||||||
hideConnectionUI
|
hideConnectionUI
|
||||||
|
brandedFooter={false}
|
||||||
|
permit2={permit2Enabled}
|
||||||
routerUrl={WIDGET_ROUTER_URL}
|
routerUrl={WIDGET_ROUTER_URL}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
|
14
yarn.lock
14
yarn.lock
@ -4241,7 +4241,7 @@
|
|||||||
resolved "https://registry.npmjs.org/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz"
|
resolved "https://registry.npmjs.org/@uniswap/merkle-distributor/-/merkle-distributor-1.0.1.tgz"
|
||||||
integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw==
|
integrity sha512-5gDiTI5hrXIh5UWTrxKYjw30QQDnpl8ckDSpefldNenDlYO1RKkdUYMYpvrqGi2r7YzLYTlO6+TDlNs6O7hDRw==
|
||||||
|
|
||||||
"@uniswap/permit2-sdk@^1.2.0":
|
"@uniswap/permit2-sdk@1.2.0", "@uniswap/permit2-sdk@^1.2.0":
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@uniswap/permit2-sdk/-/permit2-sdk-1.2.0.tgz#ed86440a87a6c318169c8e6f161fc263ad040891"
|
resolved "https://registry.yarnpkg.com/@uniswap/permit2-sdk/-/permit2-sdk-1.2.0.tgz#ed86440a87a6c318169c8e6f161fc263ad040891"
|
||||||
integrity sha512-Ietv3FxN7+RCXcPSED/i/8b0a2GUZrMdyX05k3FsSztvYKyPFAMS/hBXojF0NZqYB1bHecqYc7Ej+7tV/rdYXg==
|
integrity sha512-Ietv3FxN7+RCXcPSED/i/8b0a2GUZrMdyX05k3FsSztvYKyPFAMS/hBXojF0NZqYB1bHecqYc7Ej+7tV/rdYXg==
|
||||||
@ -4329,7 +4329,7 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.30.tgz#2103ca23b8007c59ec71718d34cdc97861c409e5"
|
resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.30.tgz#2103ca23b8007c59ec71718d34cdc97861c409e5"
|
||||||
integrity sha512-HwY2VvkQ8lNR6ks5NqQfAtg+4IZqz3KV1T8d2DlI8emIn9uMmaoFbIOg0nzjqAVKKnZSbMTRRtUoAh6mmjRvog==
|
integrity sha512-HwY2VvkQ8lNR6ks5NqQfAtg+4IZqz3KV1T8d2DlI8emIn9uMmaoFbIOg0nzjqAVKKnZSbMTRRtUoAh6mmjRvog==
|
||||||
|
|
||||||
"@uniswap/universal-router-sdk@^1.2.1":
|
"@uniswap/universal-router-sdk@1.2.1", "@uniswap/universal-router-sdk@^1.2.1":
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.2.1.tgz#6ebd2830cf5abc4e132df4458e92bb33c171b604"
|
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.2.1.tgz#6ebd2830cf5abc4e132df4458e92bb33c171b604"
|
||||||
integrity sha512-NntAR9owpWy0zlDpaOiMqGHR+UK50R9pIOQBa8TwRL4cRdQpXTs9/hjynTMZYDri/fYiW/+111hv4BPwvh7RFQ==
|
integrity sha512-NntAR9owpWy0zlDpaOiMqGHR+UK50R9pIOQBa8TwRL4cRdQpXTs9/hjynTMZYDri/fYiW/+111hv4BPwvh7RFQ==
|
||||||
@ -4429,21 +4429,23 @@
|
|||||||
"@uniswap/v3-core" "1.0.0"
|
"@uniswap/v3-core" "1.0.0"
|
||||||
"@uniswap/v3-periphery" "^1.0.1"
|
"@uniswap/v3-periphery" "^1.0.1"
|
||||||
|
|
||||||
"@uniswap/widgets@2.20.0":
|
"@uniswap/widgets@2.22.0":
|
||||||
version "2.20.0"
|
version "2.22.0"
|
||||||
resolved "https://registry.yarnpkg.com/@uniswap/widgets/-/widgets-2.20.0.tgz#eb7ca21ae360a51ff04d86ec5c18255bfb0ff52e"
|
resolved "https://registry.yarnpkg.com/@uniswap/widgets/-/widgets-2.22.0.tgz#dd2ba224c7c9ef3106b5eb66c3d49d24950b9560"
|
||||||
integrity sha512-JAjcxczWJzod1QDFunKvYGpCCyneqSV6Zh6GyGaB1jbcThJ/GZ6yxmebeZIzGV+OiIFV2c2xMSjUq5KwNLSCaw==
|
integrity sha512-mY3n0zRZMak4VHZ2kBqWUvIkFyYBk4SFcTlrKP3w3W5YbXdEH/xHWO8oIuwfSOig/kveVy6jjnjSa05FWJbDhg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" ">=7.17.0"
|
"@babel/runtime" ">=7.17.0"
|
||||||
"@fontsource/ibm-plex-mono" "^4.5.1"
|
"@fontsource/ibm-plex-mono" "^4.5.1"
|
||||||
"@fontsource/inter" "^4.5.1"
|
"@fontsource/inter" "^4.5.1"
|
||||||
"@popperjs/core" "^2.4.4"
|
"@popperjs/core" "^2.4.4"
|
||||||
"@reduxjs/toolkit" "^1.6.1"
|
"@reduxjs/toolkit" "^1.6.1"
|
||||||
|
"@uniswap/permit2-sdk" "^1.2.0"
|
||||||
"@uniswap/redux-multicall" "^1.1.8"
|
"@uniswap/redux-multicall" "^1.1.8"
|
||||||
"@uniswap/router-sdk" "^1.3.0"
|
"@uniswap/router-sdk" "^1.3.0"
|
||||||
"@uniswap/sdk-core" "^3.0.1"
|
"@uniswap/sdk-core" "^3.0.1"
|
||||||
"@uniswap/smart-order-router" "^2.10.0"
|
"@uniswap/smart-order-router" "^2.10.0"
|
||||||
"@uniswap/token-lists" "^1.0.0-beta.30"
|
"@uniswap/token-lists" "^1.0.0-beta.30"
|
||||||
|
"@uniswap/universal-router-sdk" "^1.2.1"
|
||||||
"@uniswap/v2-sdk" "^3.0.1"
|
"@uniswap/v2-sdk" "^3.0.1"
|
||||||
"@uniswap/v3-sdk" "^3.8.2"
|
"@uniswap/v3-sdk" "^3.8.2"
|
||||||
"@web3-react/core" "8.0.35-beta.0"
|
"@web3-react/core" "8.0.35-beta.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user