diff --git a/.eslintrc.json b/.eslintrc.json index c7a5d5b77fa..cb83684f3d4 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 fd1217f1027..3164110ebdd 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: @@ -39,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 + 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 5e8455c571e..79253627a32 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 b635013d7ef..7f22424da3c 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 d350fe15137..d65d246d15b 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 59d814e8180..4ab04479a59 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 1c8845a733e..81fb5a567bd 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 f83722e278b..c36bf0bc96c 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 21c07147697..d07a531ebbf 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 ebcf87590f9..294e6228b86 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' @@ -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 - + Something went wrong - + - {error.stack} + {error.stack} - - - - - Create an issue on GitHub - - - - - - - - Get support on Discord - - - - - + {IS_UNISWAP ? ( + + + + + Create an issue on GitHub + + + + + + + + Get support on Discord + + + + + + ) : null} @@ -121,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 83f504844b1..8193fffeab1 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 95e5576adfa..814d7bd9b32 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 0cfa5cba288..f6d3236192a 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 85a2816e572..013b9c564cb 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 3bd9fe9e9bd..6a6da407c17 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/Identicon/index.tsx b/src/components/Identicon/index.tsx index f873068cd79..01043ebbd4c 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 { useLayoutEffect, useMemo, useRef, useState } from 'react' import styled from 'styled-components/macro' import { useActiveWeb3React } from '../../hooks/web3' @@ -20,27 +20,29 @@ 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 + 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) } } return - }, [account, avatar, fetchable]) + }, [icon, iconRef]) return ( - - {avatar && fetchable && ( + + {avatar && fetchable ? ( setFetchable(false)}> + ) : ( + )} ) diff --git a/src/components/InputStepCounter/InputStepCounter.tsx b/src/components/InputStepCounter/InputStepCounter.tsx index e0a033e303c..5380dca010f 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 7a0e2401ef2..ea7953e5e17 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 b85fb19585d..acbb0a3433d 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 2ed6899e5e4..ad9075c129d 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 4d8de801a25..1a093223222 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 49e969cc21d..41f309bc5e7 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 45ca2c6104e..f3528870da8 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 62e519b2f23..e9755ad568a 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 f45bfe576c4..23b67781829 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 9e4690fe076..2bc4dc436c7 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 c5cba0035e6..33f6bcbb967 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 b4092b9669d..0b4e0e0ab50 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 077a827b2f4..c369dafa525 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 ce98d4f05d3..3d5f25cabbf 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 808a3ba15d8..762688ef6ae 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. - + )}