From 5a4c7890c65f598a9e757d1d606fd2a59f5b1015 Mon Sep 17 00:00:00 2001 From: Crowdin Bot Date: Thu, 25 Nov 2021 20:06:51 +0000 Subject: [PATCH 01/14] chore(i18n): synchronize translations from crowdin [skip ci] --- src/locales/ru-RU.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/ru-RU.po b/src/locales/ru-RU.po index 18621b20be..8ca11728bb 100644 --- a/src/locales/ru-RU.po +++ b/src/locales/ru-RU.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: uniswap-interface\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-11-18 19:06\n" +"PO-Revision-Date: 2021-11-25 20:06\n" "Last-Translator: \n" "Language: ru_RU\n" "Language-Team: Russian\n" @@ -305,11 +305,11 @@ msgstr "Подходит для большинства пар." #: src/components/FeeSelector/shared.tsx msgid "Best for stable pairs." -msgstr "Подходит для пар стейблкоинов." +msgstr "Подходит для стабильных пар." #: src/components/FeeSelector/shared.tsx msgid "Best for very stable pairs." -msgstr "Подходит для пар очень стабильных стейблкоинов." +msgstr "Подходит для очень стабильных пар." #: src/components/Blocklist/index.tsx msgid "Blocked address" From b1009b0e036c1dcc734b9e5592a7285d9a202b8f Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Sun, 28 Nov 2021 12:07:51 -0500 Subject: [PATCH 02/14] chore: fix the build blocking linter error --- src/state/application/updater.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/application/updater.ts b/src/state/application/updater.ts index 757fc0de2d..cae7ca1b13 100644 --- a/src/state/application/updater.ts +++ b/src/state/application/updater.ts @@ -23,7 +23,7 @@ function useQueryCacheInvalidator() { } export default function Updater(): null { - const { account, chainId, library, connector } = useActiveWeb3React() + const { account, chainId, library } = useActiveWeb3React() const dispatch = useAppDispatch() const windowVisible = useIsWindowVisible() From f7ecdc4332a3bb2cbd21c14718bba79ff66361f6 Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Sun, 28 Nov 2021 12:30:58 -0500 Subject: [PATCH 03/14] chore: run linters with auto_fix = false for forks (#2852) --- .github/workflows/lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd1217f102..4ed1b23e59 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,6 @@ on: jobs: run-linters: name: Run linters - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} runs-on: ubuntu-latest steps: @@ -45,4 +44,4 @@ jobs: github_token: ${{ secrets.github_token }} eslint: true eslint_extensions: js,jsx,ts,tsx,json - auto_fix: true + auto_fix: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} From 6b57ffe3119a292c648d7e73ec40bf87a8ea2fbe Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Mon, 29 Nov 2021 12:44:14 -0500 Subject: [PATCH 04/14] fix: do not show urls if issue is not occurring on app.uniswap.org (#2855) * fix: do not show urls if issue is not occurring on app.uniswap.org fixes https://github.com/Uniswap/interface/issues/2572 * address comment --- src/components/ErrorBoundary/index.tsx | 53 ++++++++++++++------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/src/components/ErrorBoundary/index.tsx b/src/components/ErrorBoundary/index.tsx index ebcf87590f..c0acccaf0d 100644 --- a/src/components/ErrorBoundary/index.tsx +++ b/src/components/ErrorBoundary/index.tsx @@ -47,6 +47,8 @@ type ErrorBoundaryState = { error: Error | null } +const IS_UNISWAP = window.location.hostname === 'app.uniswap.org' + export default class ErrorBoundary extends React.Component { constructor(props: unknown) { super(props) @@ -67,6 +69,7 @@ export default class ErrorBoundary extends React.Component{error.stack} - - - - - Create an issue on GitHub - - - - - - - - Get support on Discord - - - - - + {IS_UNISWAP ? ( + + + + + Create an issue on GitHub + + + + + + + + Get support on Discord + + + + + + ) : null} From 709f0299e2f8bcd369477fe64383915e1b260d4f Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Mon, 29 Nov 2021 12:15:08 -0800 Subject: [PATCH 05/14] fix: remove orphaned node (#2863) * fix: remove orphaned node * fix: react cleanup --- src/components/Identicon/index.tsx | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/Identicon/index.tsx b/src/components/Identicon/index.tsx index f873068cd7..095fcbfa2a 100644 --- a/src/components/Identicon/index.tsx +++ b/src/components/Identicon/index.tsx @@ -1,6 +1,6 @@ import jazzicon from '@metamask/jazzicon' import useENSAvatar from 'hooks/useENSAvatar' -import { useEffect, useRef, useState } from 'react' +import { useCallback, useState } from 'react' import styled from 'styled-components/macro' import { useActiveWeb3React } from '../../hooks/web3' @@ -20,27 +20,28 @@ const StyledAvatar = styled.img` ` export default function Identicon() { - const ref = useRef(null) const { account } = useActiveWeb3React() const { avatar } = useENSAvatar(account ?? undefined) const [fetchable, setFetchable] = useState(true) - useEffect(() => { - if ((!avatar || !fetchable) && account) { - const icon = jazzicon(16, parseInt(account?.slice(2, 10), 16)) - const current = ref.current - current?.appendChild(icon) - return () => { - current?.removeChild(icon) + const setJazzicon = useCallback( + (ref: HTMLSpanElement | null) => { + if (account) { + ref?.appendChild(jazzicon(16, parseInt(account?.slice(2, 10), 16))) } - } - return - }, [account, avatar, fetchable]) + }, + [account] + ) return ( - - {avatar && fetchable && ( + + {avatar && fetchable ? ( setFetchable(false)}> + ) : ( + )} ) From efdfdc90835f0e38e1fdb4a61e74e69e41799d9f Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Mon, 29 Nov 2021 15:49:01 -0800 Subject: [PATCH 06/14] refactor: use ref for jazzicon (#2874) --- src/components/Identicon/index.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Identicon/index.tsx b/src/components/Identicon/index.tsx index 095fcbfa2a..01043ebbd4 100644 --- a/src/components/Identicon/index.tsx +++ b/src/components/Identicon/index.tsx @@ -1,6 +1,6 @@ import jazzicon from '@metamask/jazzicon' import useENSAvatar from 'hooks/useENSAvatar' -import { useCallback, useState } from 'react' +import { useLayoutEffect, useMemo, useRef, useState } from 'react' import styled from 'styled-components/macro' import { useActiveWeb3React } from '../../hooks/web3' @@ -24,24 +24,25 @@ export default function Identicon() { const { avatar } = useENSAvatar(account ?? undefined) const [fetchable, setFetchable] = useState(true) - const setJazzicon = useCallback( - (ref: HTMLSpanElement | null) => { - if (account) { - ref?.appendChild(jazzicon(16, parseInt(account?.slice(2, 10), 16))) + const icon = useMemo(() => account && jazzicon(16, parseInt(account.slice(2, 10), 16)), [account]) + const iconRef = useRef(null) + useLayoutEffect(() => { + const current = iconRef.current + if (icon) { + current?.appendChild(icon) + return () => { + current?.removeChild(icon) } - }, - [account] - ) + } + return + }, [icon, iconRef]) return ( {avatar && fetchable ? ( setFetchable(false)}> ) : ( - + )} ) From f43fd89884c9dd8397f03e4db997b6d0d0be8c46 Mon Sep 17 00:00:00 2001 From: Crowdin Bot Date: Tue, 30 Nov 2021 02:11:35 +0000 Subject: [PATCH 07/14] chore(i18n): synchronize translations from crowdin [skip ci] --- src/locales/ja-JP.po | 10 +++++----- src/locales/zh-CN.po | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/locales/ja-JP.po b/src/locales/ja-JP.po index 94cf303734..baea2cabb5 100644 --- a/src/locales/ja-JP.po +++ b/src/locales/ja-JP.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: uniswap-interface\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-11-18 19:06\n" +"PO-Revision-Date: 2021-11-30 02:11\n" "Last-Translator: \n" "Language: ja_JP\n" "Language-Team: Japanese\n" @@ -309,7 +309,7 @@ msgstr "安定的なペアに最適" #: src/components/FeeSelector/shared.tsx msgid "Best for very stable pairs." -msgstr "非常に安定したペアに最適です。" +msgstr "非常に安定したペアに最適" #: src/components/Blocklist/index.tsx msgid "Blocked address" @@ -329,7 +329,7 @@ msgstr "このリストを追加することで、データが正しいことを #: src/components/WalletModal/index.tsx msgid "By connecting a wallet, you agree to Uniswap Labs’ <0>Terms of Service and acknowledge that you have read and understand the Uniswap <1>Protocol Disclaimer." -msgstr "財布を接続することにより、あなたはUniswap Labsのに同意 <0>サービス規約 、あなたが読んでUniswap理解していることを認める <1>プロトコル免責事項。" +msgstr "ウォレットを接続することにより、あなたはUniswap Labsのに <0>サービス規約に同意し、あなたがUniswap<1>プロトコル免責事項を読み、理解していることに同意するものとします。" #: src/pages/Vote/styled.tsx msgid "Canceled" @@ -1541,7 +1541,7 @@ msgstr "スワップ" #: src/components/AccountDetails/TransactionSummary.tsx msgid "Swap <0/> for exactly <1/>" -msgstr "<0/> を <1/>に正確にスワップする" +msgstr "<0/> を <1/>にスワップ" #: src/pages/Swap/index.tsx #: src/pages/Swap/index.tsx @@ -1550,7 +1550,7 @@ msgstr "問題発生の可能性があるが、スワップする" #: src/components/AccountDetails/TransactionSummary.tsx msgid "Swap exactly <0/> for <1/>" -msgstr "正確に<0/>を<1/>に交換します" +msgstr "<0/>を<1/>にスワップ" #: src/hooks/useSwapCallback.tsx #: src/hooks/useSwapCallback.tsx diff --git a/src/locales/zh-CN.po b/src/locales/zh-CN.po index 7ea6bfcf04..8fd76f4dc3 100644 --- a/src/locales/zh-CN.po +++ b/src/locales/zh-CN.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: uniswap-interface\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-11-18 19:06\n" +"PO-Revision-Date: 2021-11-30 02:11\n" "Last-Translator: \n" "Language: zh_CN\n" "Language-Team: Chinese Simplified\n" From 876c1539d46974bf513b3d064d2967d309607b7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 11:38:15 -0500 Subject: [PATCH 08/14] chore(deps): bump ws from 5.2.2 to 5.2.3 (#2759) Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c1f384bd8b..e42cbbfe39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21201,9 +21201,9 @@ ws@>=7.4.6: integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== ws@^5.1.1: - version "5.2.2" - resolved "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + version "5.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d" + integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA== dependencies: async-limiter "~1.0.0" From 82a079935e46c81ae6faaa8de04675f840b1ada9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 11:40:15 -0500 Subject: [PATCH 09/14] chore(deps): bump url-parse from 1.5.1 to 1.5.3 (#2504) Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.3) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e42cbbfe39..0fca1ff0ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20372,9 +20372,9 @@ url-parse-lax@^3.0.0: prepend-http "^2.0.0" url-parse@^1.4.3, url-parse@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" - integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== + version "1.5.3" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862" + integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" From 0e25c055fb20f9d249c762ca326e4739e6c315d9 Mon Sep 17 00:00:00 2001 From: Justin Domingue Date: Tue, 30 Nov 2021 11:44:40 -0500 Subject: [PATCH 10/14] add more tests for tryParseTick (#2110) --- src/state/mint/v3/utils.test.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/state/mint/v3/utils.test.ts b/src/state/mint/v3/utils.test.ts index dacf70af9a..6cde1da04f 100644 --- a/src/state/mint/v3/utils.test.ts +++ b/src/state/mint/v3/utils.test.ts @@ -16,7 +16,7 @@ describe('hooks', () => { expect(tryParsePrice(baseToken, quoteToken, '20.')).toEqual(undefined) }) - it('should return a price', () => { + it('should return a price when decimals are the same', () => { const baseToken = new Token(1, '0x6b175474e89094c44da98b954eedeac495271d0f', 6) const quoteToken = new Token(1, '0x1b175474e89094c44da98b954eedeac495271d0f', 6) @@ -36,5 +36,26 @@ describe('hooks', () => { tryParsePrice(baseToken, quoteToken, /* ~2^-128 */ '0.000000000000000000000000000587747')?.toSignificant(6) ).toEqual('0.000000000000000000000000000587747') }) + + it('should return a price when decimals are different', () => { + const baseToken = new Token(1, '0x6b175474e89094c44da98b954eedeac495271d0f', 2) + const quoteToken = new Token(1, '0x1b175474e89094c44da98b954eedeac495271d0f', 4) + + expect(tryParsePrice(baseToken, quoteToken, '20')?.toSignificant(6)).toEqual('20') + expect(tryParsePrice(baseToken, quoteToken, '20.05')?.toSignificant(6)).toEqual('20.05') + expect(tryParsePrice(baseToken, quoteToken, '20.123456789')?.toSignificant(6)).toEqual('20.1235') + expect(tryParsePrice(baseToken, quoteToken, '0.123456789')?.toSignificant(6)).toEqual('0.123457') + expect(tryParsePrice(baseToken, quoteToken, '.123456789')?.toSignificant(6)).toEqual('0.123457') + expect( + tryParsePrice( + baseToken, + quoteToken, + (2 ** 128).toLocaleString('fullwide', { useGrouping: false }) + )?.toSignificant(6) + ).toEqual('340282000000000000000000000000000000000') + expect( + tryParsePrice(baseToken, quoteToken, /* ~2^-128 */ '0.000000000000000000000000000587747')?.toSignificant(6) + ).toEqual('0.000000000000000000000000000587747') + }) }) }) From 745be977efc24be72f75d8123d9dcaa5faa4baf9 Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Tue, 30 Nov 2021 15:20:59 -0500 Subject: [PATCH 11/14] fix(lint): clean up the eslint config (#2886) * fix(lint): clean up the eslint config * Fix code style issues with ESLint * fix the linter errors that arose from using the proper config * clean up the rebass text renames * fix if statement, use the config * use the same name prefix for both steps * `TextPreset` -> `ThemedText` Co-authored-by: Lint Action --- .eslintrc.json | 22 +++- .github/workflows/lint.yml | 11 +- cypress/support/commands.js | 1 + lingui.config.ts | 4 +- package.json | 6 - .../AccountDetails/TransactionSummary.tsx | 6 +- src/components/AccountDetails/index.tsx | 10 +- src/components/AddressInputPanel/index.tsx | 9 +- .../CurrencyInputPanel/FiatValue.tsx | 6 +- src/components/CurrencyInputPanel/index.tsx | 10 +- src/components/ErrorBoundary/index.tsx | 18 +-- src/components/FeeSelector/FeeOption.tsx | 8 +- .../FeeSelector/FeeTierPercentageBadge.tsx | 6 +- src/components/FeeSelector/index.tsx | 14 +-- src/components/Header/Polling.tsx | 4 +- src/components/Header/UniBalanceContent.tsx | 42 +++---- src/components/Header/index.tsx | 6 +- .../InputStepCounter/InputStepCounter.tsx | 6 +- .../LiquidityChartRangeInput/Area.tsx | 2 +- .../LiquidityChartRangeInput/index.tsx | 6 +- src/components/ModalViews/index.tsx | 10 +- src/components/NavigationTabs/index.tsx | 6 +- src/components/Popups/ClaimPopup.tsx | 16 +-- src/components/Popups/TransactionPopup.tsx | 8 +- src/components/PositionCard/index.tsx | 6 +- src/components/PositionPreview/index.tsx | 66 +++++------ src/components/PrivacyPolicy/index.tsx | 24 ++-- src/components/ProgressSteps/index.tsx | 4 +- .../RangeSelector/PresetsButtons.tsx | 6 +- .../RoutingDiagram/RoutingDiagram.tsx | 8 +- src/components/SearchModal/BlockedToken.tsx | 8 +- src/components/SearchModal/CurrencyList.tsx | 10 +- src/components/SearchModal/CurrencySearch.tsx | 10 +- src/components/SearchModal/ImportList.tsx | 40 +++---- src/components/SearchModal/ImportRow.tsx | 16 +-- src/components/SearchModal/ImportToken.tsx | 10 +- src/components/SearchModal/ManageLists.tsx | 18 +-- src/components/SearchModal/ManageTokens.tsx | 22 ++-- .../SearchModal/TokenImportCard.tsx | 20 ++-- src/components/Settings/index.tsx | 10 +- src/components/SwitchLocaleLink/index.tsx | 4 +- src/components/Toggle/ListToggle.tsx | 4 +- .../TransactionConfirmationModal/index.tsx | 6 +- src/components/TransactionSettings/index.tsx | 14 +-- src/components/WalletModal/index.tsx | 14 +-- src/components/claim/AddressClaimModal.tsx | 34 +++--- src/components/claim/ClaimModal.tsx | 48 ++++---- src/components/earn/ClaimRewardModal.tsx | 30 ++--- src/components/earn/PoolCard.tsx | 30 ++--- src/components/earn/StakingModal.tsx | 30 ++--- src/components/earn/UnstakingModal.tsx | 46 ++++---- src/components/swap/AdvancedSwapDetails.tsx | 34 +++--- src/components/swap/RouterLabel.tsx | 8 +- src/components/swap/SwapHeader.tsx | 6 +- src/components/swap/SwapModalHeader.tsx | 34 +++--- src/components/swap/SwapRoute.tsx | 10 +- src/components/swap/TradePrice.tsx | 6 +- .../swap/UnsupportedCurrencyFooter.tsx | 18 +-- src/components/swap/styleds.tsx | 4 +- src/components/vote/DelegateModal.tsx | 32 +++--- src/components/vote/ProposalEmptyState.tsx | 10 +- src/components/vote/VoteModal.tsx | 32 +++--- src/connectors/Fortmatic.ts | 8 +- src/constants/governance.ts | 2 +- src/hooks/useERC20Permit.ts | 14 +-- src/hooks/useMonitoringEventCallback.ts | 2 +- src/pages/AddLiquidity/index.tsx | 78 ++++++------- .../AddLiquidityV2/ConfirmAddModalBottom.tsx | 34 +++--- src/pages/AddLiquidityV2/PoolPriceBar.tsx | 10 +- src/pages/AddLiquidityV2/index.tsx | 30 ++--- .../ProposalSubmissionModal.tsx | 6 +- src/pages/CreateProposal/index.tsx | 6 +- src/pages/Earn/Countdown.tsx | 6 +- src/pages/Earn/Manage.tsx | 62 +++++----- src/pages/Earn/index.tsx | 18 +-- src/pages/MigrateV2/MigrateV2Pair.tsx | 101 +++++++++-------- src/pages/MigrateV2/index.tsx | 20 ++-- src/pages/Pool/CTACards.tsx | 12 +- src/pages/Pool/PositionPage.tsx | 106 +++++++++--------- src/pages/Pool/index.tsx | 18 +-- src/pages/Pool/v2.tsx | 34 +++--- src/pages/PoolFinder/index.tsx | 6 +- src/pages/RemoveLiquidity/V3.tsx | 18 +-- src/pages/RemoveLiquidity/index.tsx | 10 +- src/pages/Swap/index.tsx | 16 +-- src/pages/Vote/Landing.tsx | 36 +++--- src/pages/Vote/VotePage.tsx | 44 ++++---- src/state/application/reducer.test.ts | 6 +- src/state/governance/hooks.ts | 2 +- src/state/lists/reducer.test.ts | 2 +- src/state/multicall/reducer.test.ts | 24 ++-- src/state/multicall/updater.test.ts | 40 +++---- src/state/stake/hooks.tsx | 2 +- src/state/swap/hooks.tsx | 2 +- src/state/transactions/reducer.test.ts | 4 +- src/theme/index.tsx | 37 +++--- 96 files changed, 913 insertions(+), 872 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c7a5d5b77f..cb83684f3d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,13 +8,33 @@ "jsx": true } }, - "ignorePatterns": ["node_modules/**/*"], "settings": { "react": { "version": "detect" } }, + "ignorePatterns": [ + "src/types/v3", + "src/abis/types", + "src/locales/**/*.js", + "src/locales/**/en-US.po", + "src/state/data/generated.ts", + "node_modules", + "coverage", + "build", + "dist", + ".DS_Store", + ".env.local", + ".env.development.local", + ".env.test.local", + ".env.production.local", + ".idea/", + ".vscode/", + "package-lock.json", + "yarn.lock" + ], "extends": [ + "react-app", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended", diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4ed1b23e59..3164110ebd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -38,10 +38,15 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: Run linters + - name: Run eslint w/ autofix + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} uses: wearerequired/lint-action@36c7e6689e80d785d27a22f71d970f3a3b4fcb70 with: github_token: ${{ secrets.github_token }} eslint: true - eslint_extensions: js,jsx,ts,tsx,json - auto_fix: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} + eslint_args: "-c .eslintrc.json" + auto_fix: true + + - name: Run eslint + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }} + run: yarn eslint . diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5e8455c571..79253627a3 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -74,6 +74,7 @@ class CustomizedBridge extends Eip1193Bridge { } // sets up the injected provider to be a mock ethereum provider with the given mnemonic/index +// eslint-disable-next-line no-undef Cypress.Commands.overwrite('visit', (original, url, options) => { return original(url.startsWith('/') && url.length > 2 && !url.startsWith('/#') ? `/#${url}` : url, { ...options, diff --git a/lingui.config.ts b/lingui.config.ts index b635013d7e..7f22424da3 100644 --- a/lingui.config.ts +++ b/lingui.config.ts @@ -1,4 +1,4 @@ -export default { +const linguiConfig = { catalogs: [ { path: '/src/locales/{locale}', @@ -52,3 +52,5 @@ export default { runtimeConfigModule: ['@lingui/core', 'i18n'], sourceLocale: 'en-US', } + +export default linguiConfig diff --git a/package.json b/package.json index d350fe1513..d65d246d15 100644 --- a/package.json +++ b/package.json @@ -152,12 +152,6 @@ "bundle": "microbundle --tsconfig tsconfig.lib.json src/lib/index.tsx --format esm,cjs", "cosmos": "open http://localhost:5000 && cross-env FAST_REFRESH=false cosmos" }, - "eslintConfig": { - "extends": "react-app", - "ignorePatterns": [ - "node_modules" - ] - }, "browserslist": { "production": [ ">0.2%", diff --git a/src/components/AccountDetails/TransactionSummary.tsx b/src/components/AccountDetails/TransactionSummary.tsx index 59d814e818..4ab04479a5 100644 --- a/src/components/AccountDetails/TransactionSummary.tsx +++ b/src/components/AccountDetails/TransactionSummary.tsx @@ -80,7 +80,7 @@ function ClaimSummary({ info: { recipient, uniAmountRaw } }: { info: ClaimTransa ) } -function SubmitProposalTransactionSummary({}: { info: SubmitProposalTransactionInfo }) { +function SubmitProposalTransactionSummary(_: { info: SubmitProposalTransactionInfo }) { return Submit new proposal } @@ -147,13 +147,13 @@ function WrapSummary({ info: { currencyAmountRaw, unwrapped } }: { info: WrapTra } } -function DepositLiquidityStakingSummary({}: { info: DepositLiquidityStakingTransactionInfo }) { +function DepositLiquidityStakingSummary(_: { info: DepositLiquidityStakingTransactionInfo }) { // not worth rendering the tokens since you can should no longer deposit liquidity in the staking contracts // todo: deprecate and delete the code paths that allow this, show user more information return Deposit liquidity } -function WithdrawLiquidityStakingSummary({}: { info: WithdrawLiquidityStakingTransactionInfo }) { +function WithdrawLiquidityStakingSummary(_: { info: WithdrawLiquidityStakingTransactionInfo }) { return Withdraw deposited liquidity } diff --git a/src/components/AccountDetails/index.tsx b/src/components/AccountDetails/index.tsx index 1c8845a733..81fb5a567b 100644 --- a/src/components/AccountDetails/index.tsx +++ b/src/components/AccountDetails/index.tsx @@ -10,7 +10,7 @@ import { injected, portis, walletlink } from '../../connectors' import { SUPPORTED_WALLETS } from '../../constants/wallet' import { useActiveWeb3React } from '../../hooks/web3' import { clearAllTransactions } from '../../state/transactions/actions' -import { ExternalLink, LinkStyledButton, TYPE } from '../../theme' +import { ExternalLink, LinkStyledButton, ThemedText } from '../../theme' import { shortenAddress } from '../../utils' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { ButtonSecondary } from '../Button' @@ -378,9 +378,9 @@ export default function AccountDetails({ {!!pendingTransactions.length || !!confirmedTransactions.length ? ( - + Recent Transactions - + (clear all) @@ -390,9 +390,9 @@ export default function AccountDetails({ ) : ( - + Your transactions will appear here... - + )} diff --git a/src/components/AddressInputPanel/index.tsx b/src/components/AddressInputPanel/index.tsx index f83722e278..c36bf0bc96 100644 --- a/src/components/AddressInputPanel/index.tsx +++ b/src/components/AddressInputPanel/index.tsx @@ -1,11 +1,12 @@ +import { Trans } from '@lingui/macro' // eslint-disable-next-line no-restricted-imports -import { t, Trans } from '@lingui/macro' +import { t } from '@lingui/macro' import { ReactNode, useCallback, useContext } from 'react' import styled, { ThemeContext } from 'styled-components/macro' import useENS from '../../hooks/useENS' import { useActiveWeb3React } from '../../hooks/web3' -import { ExternalLink, TYPE } from '../../theme' +import { ExternalLink, ThemedText } from '../../theme' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { AutoColumn } from '../Column' import { RowBetween } from '../Row' @@ -107,9 +108,9 @@ export default function AddressInputPanel({ - + {label ?? Recipient} - + {address && chainId && ( + {fiatValue ? ( ~$ @@ -39,6 +39,6 @@ export function FiatValue({ ({priceImpact.multiply(-1).toSignificant(3)}%) ) : null} - + ) } diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index 21c0714769..d07a531ebb 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -13,7 +13,7 @@ import { ReactComponent as DropDown } from '../../assets/images/dropdown.svg' import useTheme from '../../hooks/useTheme' import { useActiveWeb3React } from '../../hooks/web3' import { useCurrencyBalance } from '../../state/wallet/hooks' -import { TYPE } from '../../theme' +import { ThemedText } from '../../theme' import { ButtonGray } from '../Button' import CurrencyLogo from '../CurrencyLogo' import DoubleCurrencyLogo from '../DoubleLogo' @@ -212,9 +212,9 @@ export default function CurrencyInputPanel({ - + The market price is outside your specified price range. Single-asset deposit only. - + )} @@ -271,7 +271,7 @@ export default function CurrencyInputPanel({ {account ? ( - ) ) : null} - + {showMaxButton && selectedCurrencyBalance ? ( (Max) diff --git a/src/components/ErrorBoundary/index.tsx b/src/components/ErrorBoundary/index.tsx index c0acccaf0d..294e6228b8 100644 --- a/src/components/ErrorBoundary/index.tsx +++ b/src/components/ErrorBoundary/index.tsx @@ -4,7 +4,7 @@ import ReactGA from 'react-ga' import styled from 'styled-components/macro' import store, { AppState } from '../../state' -import { ExternalLink, TYPE } from '../../theme' +import { ExternalLink, ThemedText } from '../../theme' import { userAgent } from '../../utils/userAgent' import { AutoColumn } from '../Column' import { AutoRow } from '../Row' @@ -77,13 +77,13 @@ export default class ErrorBoundary extends React.Component - + Something went wrong - + - {error.stack} + {error.stack} {IS_UNISWAP ? ( @@ -96,18 +96,18 @@ export default class ErrorBoundary extends React.Component - + Create an issue on GitHub - + - + Get support on Discord - + @@ -126,7 +126,7 @@ function getRelevantState(): null | keyof AppState { if (!path.startsWith('#/')) { return null } - const pieces = path.substring(2).split(/[\/\\?]/) + const pieces = path.substring(2).split(/[/\\?]/) switch (pieces[0]) { case 'swap': return 'swap' diff --git a/src/components/FeeSelector/FeeOption.tsx b/src/components/FeeSelector/FeeOption.tsx index 83f504844b..8193fffeab 100644 --- a/src/components/FeeSelector/FeeOption.tsx +++ b/src/components/FeeSelector/FeeOption.tsx @@ -6,12 +6,12 @@ import { useFeeTierDistribution } from 'hooks/useFeeTierDistribution' import { PoolState } from 'hooks/usePools' import React from 'react' import styled from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import { FeeTierPercentageBadge } from './FeeTierPercentageBadge' import { FEE_AMOUNT_DETAIL } from './shared' -const ResponsiveText = styled(TYPE.label)` +const ResponsiveText = styled(ThemedText.Label)` line-height: 16px; font-size: 14px; @@ -37,9 +37,9 @@ export function FeeOption({ feeAmount, active, poolState, distributions, onClick {FEE_AMOUNT_DETAIL[feeAmount].label}% - + {FEE_AMOUNT_DETAIL[feeAmount].description} - + {distributions && ( diff --git a/src/components/FeeSelector/FeeTierPercentageBadge.tsx b/src/components/FeeSelector/FeeTierPercentageBadge.tsx index 95e5576adf..814d7bd9b3 100644 --- a/src/components/FeeSelector/FeeTierPercentageBadge.tsx +++ b/src/components/FeeSelector/FeeTierPercentageBadge.tsx @@ -4,7 +4,7 @@ import Badge from 'components/Badge' import { useFeeTierDistribution } from 'hooks/useFeeTierDistribution' import { PoolState } from 'hooks/usePools' import React from 'react' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' export function FeeTierPercentageBadge({ feeAmount, @@ -17,7 +17,7 @@ export function FeeTierPercentageBadge({ }) { return ( - + {!distributions || poolState === PoolState.NOT_EXISTS || poolState === PoolState.INVALID ? ( Not created ) : distributions[feeAmount] !== undefined ? ( @@ -25,7 +25,7 @@ export function FeeTierPercentageBadge({ ) : ( No data )} - + ) } diff --git a/src/components/FeeSelector/index.tsx b/src/components/FeeSelector/index.tsx index 0cfa5cba28..f6d3236192 100644 --- a/src/components/FeeSelector/index.tsx +++ b/src/components/FeeSelector/index.tsx @@ -14,7 +14,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import ReactGA from 'react-ga' import { Box } from 'rebass' import styled, { keyframes } from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import { FeeOption } from './FeeOption' import { FeeTierPercentageBadge } from './FeeTierPercentageBadge' @@ -149,18 +149,18 @@ export default function FeeSelector({ {!feeAmount ? ( <> - + Fee tier - - + + The % you will earn in fees. - + ) : ( <> - + {FEE_AMOUNT_DETAIL[feeAmount].label}% fee tier - + {distributions && ( ` display: none; `} ` -const StyledPollingNumber = styled(TYPE.small)<{ breathe: boolean; hovering: boolean }>` +const StyledPollingNumber = styled(ThemedText.Small)<{ breathe: boolean; hovering: boolean }>` transition: opacity 0.25s ease; opacity: ${({ breathe, hovering }) => (hovering ? 0.7 : breathe ? 1 : 0.5)}; :hover { diff --git a/src/components/Header/UniBalanceContent.tsx b/src/components/Header/UniBalanceContent.tsx index 85a2816e57..013b9c564c 100644 --- a/src/components/Header/UniBalanceContent.tsx +++ b/src/components/Header/UniBalanceContent.tsx @@ -14,7 +14,7 @@ import useUSDCPrice from '../../hooks/useUSDCPrice' import { useActiveWeb3React } from '../../hooks/web3' import { useTotalUniEarned } from '../../state/stake/hooks' import { useAggregateUniBalance, useTokenBalance } from '../../state/wallet/hooks' -import { ExternalLink, StyledInternalLink, TYPE, UniTokenAnimated } from '../../theme' +import { ExternalLink, StyledInternalLink, ThemedText, UniTokenAnimated } from '../../theme' import { computeUniCirculation } from '../../utils/computeUniCirculation' import { AutoColumn } from '../Column' import { Break, CardBGImage, CardNoise, CardSection, DataCard } from '../earn/styled' @@ -70,9 +70,9 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU - + Your UNI Breakdown - + setShowUniBalanceModal(false)} /> @@ -82,29 +82,29 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU {' '} - + {total?.toFixed(2, { groupSeparator: ',' })} - + - + Balance: - - {uniBalance?.toFixed(2, { groupSeparator: ',' })} + + {uniBalance?.toFixed(2, { groupSeparator: ',' })} - + Unclaimed: - - + + {uniToClaim?.toFixed(4, { groupSeparator: ',' })}{' '} {uniToClaim && uniToClaim.greaterThan('0') && ( setShowUniBalanceModal(false)} to="/uni"> (claim) )} - + @@ -114,22 +114,22 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU - + UNI price: - - ${uniPrice?.toFixed(2) ?? '-'} + + ${uniPrice?.toFixed(2) ?? '-'} - + UNI in circulation: - - {circulation?.toFixed(0, { groupSeparator: ',' })} + + {circulation?.toFixed(0, { groupSeparator: ',' })} - + Total Supply - - {totalSupply?.toFixed(0, { groupSeparator: ',' })} + + {totalSupply?.toFixed(0, { groupSeparator: ',' })} {uni && uni.chainId === 1 ? ( diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 3bd9fe9e9b..6a6da407c1 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -15,7 +15,7 @@ import styled from 'styled-components/macro' import { ReactComponent as Logo } from '../../assets/svg/logo.svg' import { useActiveWeb3React } from '../../hooks/web3' -import { ExternalLink, TYPE } from '../../theme' +import { ExternalLink, ThemedText } from '../../theme' import ClaimModal from '../claim/ClaimModal' import { CardNoise } from '../earn/styled' import Menu from '../Menu' @@ -309,7 +309,7 @@ export default function Header() { {availableClaim && !showClaimPopup && ( - + {claimTxn && !claimTxn?.receipt ? ( Claiming UNI @@ -317,7 +317,7 @@ export default function Header() { ) : ( Claim UNI )} - + diff --git a/src/components/InputStepCounter/InputStepCounter.tsx b/src/components/InputStepCounter/InputStepCounter.tsx index e0a033e303..5380dca010 100644 --- a/src/components/InputStepCounter/InputStepCounter.tsx +++ b/src/components/InputStepCounter/InputStepCounter.tsx @@ -6,7 +6,7 @@ import { AutoColumn } from 'components/Column' import { ReactNode, useCallback, useEffect, useState } from 'react' import { Minus, Plus } from 'react-feather' import styled, { keyframes } from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import { Input as NumericalInput } from '../NumericalInput' @@ -57,13 +57,13 @@ const StyledInput = styled(NumericalInput)<{ usePercent?: boolean }>` `}; ` -const InputTitle = styled(TYPE.small)` +const InputTitle = styled(ThemedText.Small)` color: ${({ theme }) => theme.text2}; font-size: 12px; font-weight: 500; ` -const ButtonLabel = styled(TYPE.white)<{ disabled: boolean }>` +const ButtonLabel = styled(ThemedText.White)<{ disabled: boolean }>` color: ${({ theme, disabled }) => (disabled ? theme.text2 : theme.text1)} !important; ` diff --git a/src/components/LiquidityChartRangeInput/Area.tsx b/src/components/LiquidityChartRangeInput/Area.tsx index 7a0e2401ef..ea7953e5e1 100644 --- a/src/components/LiquidityChartRangeInput/Area.tsx +++ b/src/components/LiquidityChartRangeInput/Area.tsx @@ -37,7 +37,7 @@ export const Area = ({ .y0(yScale(0))( series.filter((d) => { const value = xScale(xValue(d)) - return value > 0 && value <= innerWidth + return value > 0 && value <= window.innerWidth }) as Iterable<[number, number]> ) ?? undefined } diff --git a/src/components/LiquidityChartRangeInput/index.tsx b/src/components/LiquidityChartRangeInput/index.tsx index b85fb19585..acbb0a3433 100644 --- a/src/components/LiquidityChartRangeInput/index.tsx +++ b/src/components/LiquidityChartRangeInput/index.tsx @@ -14,7 +14,7 @@ import { batch } from 'react-redux' import { Bound } from 'state/mint/v3/actions' import styled from 'styled-components/macro' -import { TYPE } from '../../theme' +import { ThemedText } from '../../theme' import { Chart } from './Chart' import { useDensityChartData } from './hooks' import { ZoomLevels } from './types' @@ -58,9 +58,9 @@ function InfoBox({ message, icon }: { message?: ReactNode; icon: ReactNode }) { {icon} {message && ( - + {message} - + )} ) diff --git a/src/components/ModalViews/index.tsx b/src/components/ModalViews/index.tsx index 2ed6899e5e..ad9075c129 100644 --- a/src/components/ModalViews/index.tsx +++ b/src/components/ModalViews/index.tsx @@ -5,7 +5,7 @@ import styled, { ThemeContext } from 'styled-components/macro' import Circle from '../../assets/images/blue-loader.svg' import { useActiveWeb3React } from '../../hooks/web3' -import { CloseIcon, CustomLightSpinner, TYPE } from '../../theme' +import { CloseIcon, CustomLightSpinner, ThemedText } from '../../theme' import { ExternalLink } from '../../theme/components' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { AutoColumn, ColumnCenter } from '../Column' @@ -32,9 +32,9 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss: {children} - + Confirm this transaction in your wallet - + ) @@ -68,9 +68,9 @@ export function SubmittedView({ href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ marginLeft: '4px' }} > - + View transaction on Explorer - + )} diff --git a/src/components/NavigationTabs/index.tsx b/src/components/NavigationTabs/index.tsx index 4d8de801a2..1a09322322 100644 --- a/src/components/NavigationTabs/index.tsx +++ b/src/components/NavigationTabs/index.tsx @@ -10,7 +10,7 @@ import { useAppDispatch } from 'state/hooks' import { resetMintState } from 'state/mint/actions' import { resetMintState as resetMintV3State } from 'state/mint/v3/actions' import styled from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import Row, { RowBetween } from '../Row' import SettingsTab from '../Settings' @@ -136,7 +136,7 @@ export function AddRemoveTabs({ > - Remove Liquidity )} - + {children} diff --git a/src/components/Popups/ClaimPopup.tsx b/src/components/Popups/ClaimPopup.tsx index 49e969cc21..41f309bc5e 100644 --- a/src/components/Popups/ClaimPopup.tsx +++ b/src/components/Popups/ClaimPopup.tsx @@ -6,7 +6,6 @@ import ReactGA from 'react-ga' import styled, { keyframes } from 'styled-components/macro' import tokenLogo from '../../assets/images/token-logo.png' -import { ButtonPrimary } from '../../components/Button' import { useActiveWeb3React } from '../../hooks/web3' import { useModalOpen, @@ -16,7 +15,8 @@ import { } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { useUserHasAvailableClaim, useUserUnclaimedAmount } from '../../state/claim/hooks' -import { TYPE } from '../../theme' +import { ThemedText } from '../../theme' +import { ButtonPrimary } from '../Button' import { AutoColumn } from '../Column' import { CardBGImage, CardNoise } from '../earn/styled' @@ -98,10 +98,10 @@ export default function ClaimPopup() { {' '} - + {unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI - - + + 🎉 {' '} @@ -109,12 +109,12 @@ export default function ClaimPopup() { 🎉 - - + + Thanks for being part of the Uniswap community - + diff --git a/src/components/Popups/TransactionPopup.tsx b/src/components/Popups/TransactionPopup.tsx index 45ca2c6104..f3528870da 100644 --- a/src/components/Popups/TransactionPopup.tsx +++ b/src/components/Popups/TransactionPopup.tsx @@ -4,8 +4,8 @@ import styled, { ThemeContext } from 'styled-components/macro' import { useActiveWeb3React } from '../../hooks/web3' import { useTransaction } from '../../state/transactions/hooks' -import { TYPE } from '../../theme' -import { ExternalLink } from '../../theme/components' +import { ThemedText } from '../../theme' +import { ExternalLink } from '../../theme' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { TransactionSummary } from '../AccountDetails/TransactionSummary' import { AutoColumn } from '../Column' @@ -30,9 +30,9 @@ export default function TransactionPopup({ hash }: { hash: string }) { {success ? : } - + - + {chainId && ( View on Explorer diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index 62e519b2f2..e9755ad568 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -14,7 +14,7 @@ import { useColor } from '../../hooks/useColor' import { useTotalSupply } from '../../hooks/useTotalSupply' import { useActiveWeb3React } from '../../hooks/web3' import { useTokenBalance } from '../../state/wallet/hooks' -import { ExternalLink, TYPE } from '../../theme' +import { ExternalLink, ThemedText } from '../../theme' import { currencyId } from '../../utils/currencyId' import { unwrappedToken } from '../../utils/unwrappedToken' import { ButtonEmpty, ButtonPrimary, ButtonSecondary } from '../Button' @@ -142,7 +142,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos ) : ( - + ⭐️ {' '} @@ -150,7 +150,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos By adding liquidity you'll earn 0.3% of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity. {' '} - + )} diff --git a/src/components/PositionPreview/index.tsx b/src/components/PositionPreview/index.tsx index f45bfe576c..23b6778182 100644 --- a/src/components/PositionPreview/index.tsx +++ b/src/components/PositionPreview/index.tsx @@ -13,7 +13,7 @@ import JSBI from 'jsbi' import { ReactNode, useCallback, useContext, useState } from 'react' import { Bound } from 'state/mint/v3/actions' import { ThemeContext } from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import { formatTickPrice } from 'utils/formatTickPrice' import { unwrappedToken } from 'utils/unwrappedToken' @@ -70,9 +70,9 @@ export const PositionPreview = ({ size={24} margin={true} /> - + {currency0?.symbol} / {currency1?.symbol} - + @@ -82,36 +82,36 @@ export const PositionPreview = ({ - {currency0?.symbol} + {currency0?.symbol} - {position.amount0.toSignificant(4)} + {position.amount0.toSignificant(4)} - {currency1?.symbol} + {currency1?.symbol} - {position.amount1.toSignificant(4)} + {position.amount1.toSignificant(4)} - + Fee Tier - - + + {position?.pool?.fee / 10000}% - + - {title ? {title} :
} + {title ? {title} :
} - + Min Price - - {`${formatTickPrice( + + {`${formatTickPrice( priceLower, ticksAtLimit, Bound.LOWER - )}`} - + )}`} + {quoteCurrency.symbol} per {baseCurrency.symbol} - - + + Your position will be 100% composed of {baseCurrency?.symbol} at this price - + - + Max Price - - {`${formatTickPrice( + + {`${formatTickPrice( priceUpper, ticksAtLimit, Bound.UPPER - )}`} - + )}`} + {quoteCurrency.symbol} per {baseCurrency.symbol} - - + + Your position will be 100% composed of {quoteCurrency?.symbol} at this price - + - + Current price - - {`${price.toSignificant(5)} `} - + + {`${price.toSignificant(5)} `} + {quoteCurrency.symbol} per {baseCurrency.symbol} - + diff --git a/src/components/PrivacyPolicy/index.tsx b/src/components/PrivacyPolicy/index.tsx index 9e4690fe07..2bc4dc436c 100644 --- a/src/components/PrivacyPolicy/index.tsx +++ b/src/components/PrivacyPolicy/index.tsx @@ -5,7 +5,7 @@ import { useEffect, useRef } from 'react' import { ArrowDown, Info, X } from 'react-feather' import ReactGA from 'react-ga' import styled from 'styled-components/macro' -import { ExternalLink, TYPE } from 'theme' +import { ExternalLink, ThemedText } from 'theme' import { isMobile } from 'utils/userAgent' import { useModalOpen, useTogglePrivacyPolicy } from '../../state/application/hooks' @@ -91,9 +91,9 @@ export function PrivacyPolicyModal() { toggle()}> - + Legal & Privacy - + toggle()}> @@ -122,9 +122,9 @@ export function PrivacyPolicy() { - + Uniswap Labs' Terms of Service - + @@ -135,29 +135,29 @@ export function PrivacyPolicy() { - + Protocol Disclaimer - + - + This app uses the following third-party APIs: - + {EXTERNAL_APIS.map(({ name, description }, i) => ( - + {name} - + - {description} + {description} ))} diff --git a/src/components/ProgressSteps/index.tsx b/src/components/ProgressSteps/index.tsx index c5cba0035e..33f6bcbb96 100644 --- a/src/components/ProgressSteps/index.tsx +++ b/src/components/ProgressSteps/index.tsx @@ -2,7 +2,7 @@ import { useContext } from 'react' import styled from 'styled-components/macro' import { ThemeContext } from 'styled-components/macro' -import { TYPE } from '../../theme' +import { ThemedText } from '../../theme' import { AutoColumn } from '../Column' const Wrapper = styled(AutoColumn)` @@ -65,7 +65,7 @@ export default function ProgressCircles({ steps, disabled = false, ...rest }: Pr {step ? '✓' : i + 1 + '.'} - | + | ) })} diff --git a/src/components/RangeSelector/PresetsButtons.tsx b/src/components/RangeSelector/PresetsButtons.tsx index b4092b9669..0b4e0e0ab5 100644 --- a/src/components/RangeSelector/PresetsButtons.tsx +++ b/src/components/RangeSelector/PresetsButtons.tsx @@ -4,7 +4,7 @@ import { AutoRow } from 'components/Row' import React from 'react' import ReactGA from 'react-ga' import styled from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' const Button = styled(ButtonOutlined).attrs(() => ({ padding: '8px', @@ -26,9 +26,9 @@ export default function PresetsButtons({ setFullRange }: { setFullRange: () => v }) }} > - + Full Range - + ) diff --git a/src/components/RoutingDiagram/RoutingDiagram.tsx b/src/components/RoutingDiagram/RoutingDiagram.tsx index 077a827b2f..c369dafa52 100644 --- a/src/components/RoutingDiagram/RoutingDiagram.tsx +++ b/src/components/RoutingDiagram/RoutingDiagram.tsx @@ -7,7 +7,7 @@ import Row, { AutoRow } from 'components/Row' import { useTokenInfoFromActiveList } from 'hooks/useTokenInfoFromActiveList' import { Box } from 'rebass' import styled from 'styled-components/macro' -import { TYPE } from 'theme' +import { ThemedText } from 'theme' import { ReactComponent as DotLine } from '../../assets/svg/dot_line.svg' @@ -93,9 +93,9 @@ function Route({ percent, path }: { percent: RoutingDiagramEntry['percent']; pat - + {percent.toSignificant(2)}% - + @@ -116,7 +116,7 @@ function Pool({ currency0, currency1, feeAmount }: { currency0: Currency; curren - {feeAmount / 10000}% + {feeAmount / 10000}% ) } diff --git a/src/components/SearchModal/BlockedToken.tsx b/src/components/SearchModal/BlockedToken.tsx index ce98d4f05d..3d5f25cabb 100644 --- a/src/components/SearchModal/BlockedToken.tsx +++ b/src/components/SearchModal/BlockedToken.tsx @@ -3,7 +3,7 @@ import { Token } from '@uniswap/sdk-core' import { ButtonPrimary } from 'components/Button' import { AlertCircle, ArrowLeft } from 'react-feather' import styled from 'styled-components/macro' -import { CloseIcon, TYPE } from 'theme' +import { CloseIcon, ThemedText } from 'theme' import TokenImportCard from './TokenImportCard' @@ -22,7 +22,7 @@ const Button = styled(ButtonPrimary)` const Content = styled.div` padding: 1em; ` -const Copy = styled(TYPE.body)` +const Copy = styled(ThemedText.Body)` text-align: center; margin: 0 2em 1em !important; font-weight: 400; @@ -51,9 +51,9 @@ const BlockedToken = ({ onBack, onDismiss, blockedTokens }: BlockedTokenProps) =
{onBack ? :
} - + Token not supported - + {onDismiss ? :
}
diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index 808a3ba15d..762688ef6a 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -14,7 +14,7 @@ import { useActiveWeb3React } from '../../hooks/web3' import { useCombinedActiveList } from '../../state/lists/hooks' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' import { useCurrencyBalance } from '../../state/wallet/hooks' -import { TYPE } from '../../theme' +import { ThemedText } from '../../theme' import { isTokenOnList } from '../../utils' import Column from '../Column' import CurrencyLogo from '../CurrencyLogo' @@ -135,13 +135,13 @@ function CurrencyRow({ {currency.symbol} - + {!currency.isNative && !isOnSelectedList && customAdded ? ( {currency.name} • Added by user ) : ( currency.name )} - + {showCurrencyAmount && ( @@ -167,9 +167,9 @@ function BreakLineComponent({ style }: { style: CSSProperties }) { - + Expanded results from inactive Token Lists - + ) : ( - + No results found. - + )}