diff --git a/src/components/Badge/RangeBadge.tsx b/src/components/Badge/RangeBadge.tsx index 85698d86ae..bc27d85a16 100644 --- a/src/components/Badge/RangeBadge.tsx +++ b/src/components/Badge/RangeBadge.tsx @@ -4,7 +4,7 @@ import Badge, { BadgeVariant } from 'components/Badge' import styled from 'styled-components/macro' import { MouseoverTooltip } from '../../components/Tooltip' -import { Trans, t } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { AlertCircle } from 'react-feather' const BadgeWrapper = styled.div` @@ -43,7 +43,7 @@ export default function RangeBadge({ return ( {removed ? ( - + Your position has 0 liquidity, and is not earning fees.}>   @@ -54,7 +54,11 @@ export default function RangeBadge({ ) : inRange ? ( + The price of this pool is within your selected range. Your position is currently earning fees. + + } >   @@ -65,7 +69,11 @@ export default function RangeBadge({ ) : ( + The price of this pool is outside of your selected range. Your position is not currently earning fees. + + } > diff --git a/src/components/CurrencyInputPanel/index.tsx b/src/components/CurrencyInputPanel/index.tsx index 45bc0a2735..0f6f768654 100644 --- a/src/components/CurrencyInputPanel/index.tsx +++ b/src/components/CurrencyInputPanel/index.tsx @@ -149,7 +149,7 @@ interface CurrencyInputPanelProps { onUserInput: (value: string) => void onMax?: () => void showMaxButton: boolean - label?: string + label?: ReactNode onCurrencySelect?: (currency: Currency) => void currency?: Currency | null hideBalance?: boolean diff --git a/src/components/FeeSelector/index.tsx b/src/components/FeeSelector/index.tsx index 029a7dce8f..fda21cc7c7 100644 --- a/src/components/FeeSelector/index.tsx +++ b/src/components/FeeSelector/index.tsx @@ -1,6 +1,6 @@ import React from 'react' import { FeeAmount } from '@uniswap/v3-sdk' -import { t } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { AutoColumn } from 'components/Column' import { DynamicSection } from 'pages/AddLiquidity/styled' import { TYPE } from 'theme' @@ -26,9 +26,11 @@ export default function FeeSelector({ return ( - {t`Select Pool`} + + Select Pool + - {t`Select a pool type based on your preferred liquidity provider fee.`} + Select a pool type based on your preferred liquidity provider fee. handleFeePoolSelect(FeeAmount.LOW)} > - {t`0.05% fee`} + + 0.05% fee + - {t`Best for stable pairs.`} + Best for stable pairs. @@ -49,9 +53,11 @@ export default function FeeSelector({ onClick={() => handleFeePoolSelect(FeeAmount.MEDIUM)} > - {t`0.3% fee`} + + 0.3% fee + - {t`Best for most pairs.`} + Best for most pairs. @@ -61,9 +67,11 @@ export default function FeeSelector({ onClick={() => handleFeePoolSelect(FeeAmount.HIGH)} > - {t`1% fee`} + + 1% fee + - {t`Best for exotic pairs.`} + Best for exotic pairs. diff --git a/src/components/PositionPreview/index.tsx b/src/components/PositionPreview/index.tsx index c7b746d159..84785f5b49 100644 --- a/src/components/PositionPreview/index.tsx +++ b/src/components/PositionPreview/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useContext } from 'react' +import React, { useState, useCallback, useContext, ReactNode } from 'react' import { Position } from '@uniswap/v3-sdk' import { LightCard } from 'components/Card' import { AutoColumn } from 'components/Column' @@ -22,7 +22,7 @@ export const PositionPreview = ({ baseCurrencyDefault, }: { position: Position - title?: string + title?: ReactNode inRange: boolean baseCurrencyDefault?: Currency | undefined }) => { diff --git a/src/components/QuestionHelper/index.tsx b/src/components/QuestionHelper/index.tsx index b8c8444b71..2d2e836b17 100644 --- a/src/components/QuestionHelper/index.tsx +++ b/src/components/QuestionHelper/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react' +import React, { ReactNode, useCallback, useState } from 'react' import styled from 'styled-components/macro' import Tooltip from '../Tooltip' @@ -24,32 +24,11 @@ const QuestionWrapper = styled.div` } ` -const LightQuestionWrapper = styled.div` - display: flex; - align-items: center; - justify-content: center; - padding: 0.2rem; - border: none; - background: none; - outline: none; - cursor: default; - border-radius: 36px; - width: 24px; - height: 24px; - background-color: rgba(255, 255, 255, 0.1); - color: ${({ theme }) => theme.white}; - - :hover, - :focus { - opacity: 0.7; - } -` - const QuestionMark = styled.span` font-size: 14px; ` -export default function QuestionHelper({ text }: { text: string; size?: number }) { +export default function QuestionHelper({ text }: { text: ReactNode; size?: number }) { const [show, setShow] = useState(false) const open = useCallback(() => setShow(true), [setShow]) @@ -65,20 +44,3 @@ export default function QuestionHelper({ text }: { text: string; size?: number } ) } - -export function LightQuestionHelper({ text }: { text: string }) { - const [show, setShow] = useState(false) - - const open = useCallback(() => setShow(true), [setShow]) - const close = useCallback(() => setShow(false), [setShow]) - - return ( - - - - ? - - - - ) -} diff --git a/src/components/SearchModal/CommonBases.tsx b/src/components/SearchModal/CommonBases.tsx index 74d24b451e..e3b8c79935 100644 --- a/src/components/SearchModal/CommonBases.tsx +++ b/src/components/SearchModal/CommonBases.tsx @@ -1,4 +1,4 @@ -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' import React from 'react' import { Text } from 'rebass' import { Currency } from '@uniswap/sdk-core' @@ -44,7 +44,7 @@ export default function CommonBases({ Common bases - + These tokens are commonly paired with other tokens.} /> {bases.map((currency: Currency) => { diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx index 1e186f4aa5..397ed5bf3b 100644 --- a/src/components/SearchModal/CurrencyList.tsx +++ b/src/components/SearchModal/CurrencyList.tsx @@ -1,4 +1,4 @@ -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core' import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { FixedSizeList } from 'react-window' @@ -133,7 +133,11 @@ function CurrencyRow({ {currency.symbol} - {currency.name} {!currency.isNative && !isOnSelectedList && customAdded && '• ' + t`Added by user`} + {!currency.isNative && !isOnSelectedList && customAdded ? ( + {currency.name} • Added by user + ) : ( + currency.name + )} @@ -163,7 +167,11 @@ function BreakLineComponent({ style }: { style: CSSProperties }) { + Tokens from inactive lists. Import specific tokens below or click Manage to activate more lists. + + } /> diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index f59e0ee81d..cc5f580e00 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -199,7 +199,9 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa Toggle Expert Mode Allow high price impact trades and skip the confirm screen. Use at your own risk. + } /> Disable Multihops - + Restricts swaps to direct pairs only.} /> { - text: string + text: ReactNode } interface TooltipContentProps extends Omit { - content: React.ReactNode + content: ReactNode } export default function Tooltip({ text, ...rest }: TooltipProps) { diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index 2e731c507d..2bdde5610e 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -1,5 +1,5 @@ import { Currency } from '@uniswap/sdk-core' -import React, { useContext } from 'react' +import React, { ReactNode, useContext } from 'react' import styled, { ThemeContext } from 'styled-components' import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink' import Modal from '../Modal' @@ -45,7 +45,7 @@ export function ConfirmationPendingContent({ inline, }: { onDismiss: () => void - pendingText: string + pendingText: ReactNode inline?: boolean // not in modal }) { return ( @@ -153,10 +153,10 @@ export function ConfirmationModalContent({ onDismiss, topContent, }: { - title: string + title: ReactNode onDismiss: () => void - topContent: () => React.ReactNode - bottomContent?: () => React.ReactNode | undefined + topContent: () => ReactNode + bottomContent?: () => ReactNode | undefined }) { return ( @@ -212,7 +212,7 @@ interface ConfirmationModalProps { hash: string | undefined content: () => React.ReactNode attemptingTxn: boolean - pendingText: string + pendingText: React.ReactNode currencyToAdd?: Currency | undefined } diff --git a/src/components/TransactionSettings/index.tsx b/src/components/TransactionSettings/index.tsx index 4d9ac197ae..7ca45e0cb2 100644 --- a/src/components/TransactionSettings/index.tsx +++ b/src/components/TransactionSettings/index.tsx @@ -159,7 +159,9 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction Slippage tolerance Your transaction will revert if the price changes unfavorably by more than this percentage. + } /> @@ -208,11 +210,13 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction color: slippageError ? 'red' : '#F3841E', }} > - {slippageError - ? t`Enter a valid slippage percentage` - : tooLow - ? t`Your transaction may fail` - : t`Your transaction may be frontrun`} + {slippageError ? ( + Enter a valid slippage percentage + ) : tooLow ? ( + Your transaction may fail + ) : ( + Your transaction may be frontrun + )} ) : null} diff --git a/src/components/WalletModal/index.tsx b/src/components/WalletModal/index.tsx index 76115ca2b1..038c70d4cf 100644 --- a/src/components/WalletModal/index.tsx +++ b/src/components/WalletModal/index.tsx @@ -16,7 +16,7 @@ import { ApplicationModal } from '../../state/application/actions' import { useModalOpen, useWalletModalToggle } from '../../state/application/hooks' import { ExternalLink, TYPE } from '../../theme' import AccountDetails from '../AccountDetails' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' import Modal from '../Modal' import Option from './Option' @@ -240,7 +240,7 @@ export default function WalletModal({ id={`connect-${key}`} key={key} color={'#E8831D'} - header={t`Install Metamask`} + header={Install Metamask} subheader={null} link={'https://metamask.io/'} icon={MetamaskIcon} diff --git a/src/components/Web3Status/index.tsx b/src/components/Web3Status/index.tsx index 5e42492592..38b7dd1972 100644 --- a/src/components/Web3Status/index.tsx +++ b/src/components/Web3Status/index.tsx @@ -204,7 +204,7 @@ function Web3StatusInner() { return ( - {error instanceof UnsupportedChainIdError ? t`Wrong Network` : t`Error`} + {error instanceof UnsupportedChainIdError ? Wrong Network : Error} ) } else { diff --git a/src/components/vote/DelegateModal.tsx b/src/components/vote/DelegateModal.tsx index 65ddb6584c..02f85517a4 100644 --- a/src/components/vote/DelegateModal.tsx +++ b/src/components/vote/DelegateModal.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { ReactNode, useState } from 'react' import { UNI } from '../../constants/tokens' import Modal from '../Modal' @@ -38,7 +38,7 @@ const TextButton = styled.div` interface VoteModalProps { isOpen: boolean onDismiss: () => void - title: string + title: ReactNode } export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalProps) { diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index eade69d6b1..ae21013273 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -473,7 +473,11 @@ export default function AddLiquidity({ )} {hasExistingPosition && existingPosition ? ( - + Selected Range} + inRange={!outOfRange} + /> ) : ( <> ( You are creating a pool : You will receive} onDismiss={handleDismissConfirmation} topContent={modalHeader} bottomContent={modalBottom} diff --git a/src/pages/MigrateV2/MigrateV2Pair.tsx b/src/pages/MigrateV2/MigrateV2Pair.tsx index 881db2f2a9..6caa9936ea 100644 --- a/src/pages/MigrateV2/MigrateV2Pair.tsx +++ b/src/pages/MigrateV2/MigrateV2Pair.tsx @@ -1,5 +1,5 @@ import JSBI from 'jsbi' -import React, { useCallback, useMemo, useState, useEffect } from 'react' +import React, { useCallback, useMemo, useState, useEffect, ReactNode } from 'react' import { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core' import { FACTORY_ADDRESS } from '@uniswap/v2-sdk' import { Redirect, RouteComponentProps } from 'react-router' @@ -34,7 +34,7 @@ import { TransactionResponse } from '@ethersproject/providers' import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks' import { useV3DerivedMintInfo, useRangeHopCallbacks, useV3MintActionHandlers } from 'state/mint/v3/hooks' import { Bound, resetMintState } from 'state/mint/v3/actions' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { AlertCircle, AlertTriangle, ArrowDown } from 'react-feather' import FeeSelector from 'components/FeeSelector' import RangeSelector from 'components/RangeSelector' @@ -54,7 +54,7 @@ const ZERO = JSBI.BigInt(0) const DEFAULT_MIGRATE_SLIPPAGE_TOLERANCE = new Percent(75, 10_000) -function EmptyState({ message }: { message: string }) { +function EmptyState({ message }: { message: ReactNode }) { return ( {message} @@ -750,7 +750,7 @@ export default function MigrateV2Pair({ token1={token1} /> ) : ( - + Loading} /> )} diff --git a/src/pages/MigrateV2/index.tsx b/src/pages/MigrateV2/index.tsx index ba38cc8817..911cca3aa8 100644 --- a/src/pages/MigrateV2/index.tsx +++ b/src/pages/MigrateV2/index.tsx @@ -18,7 +18,7 @@ import MigrateSushiPositionCard from 'components/PositionCard/Sushi' import { PairState, useV2Pairs } from 'hooks/useV2Pairs' import { getCreate2Address } from '@ethersproject/address' import { pack, keccak256 } from '@ethersproject/solidity' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' function EmptyState({ message }: { message: ReactNode }) { return ( @@ -115,7 +115,7 @@ export default function MigrateV2() { Migrate V2 Liquidity
- + Migrate your liquidity tokens from Uniswap V2 to Uniswap V3.} />
diff --git a/src/pages/Pool/PositionPage.tsx b/src/pages/Pool/PositionPage.tsx index f54995d4fa..dff931f096 100644 --- a/src/pages/Pool/PositionPage.tsx +++ b/src/pages/Pool/PositionPage.tsx @@ -19,7 +19,7 @@ import Badge from 'components/Badge' import { ButtonConfirmed, ButtonPrimary, ButtonGray } from 'components/Button' import { DarkCard, LightCard } from 'components/Card' import CurrencyLogo from 'components/CurrencyLogo' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { currencyId } from 'utils/currencyId' import { formatCurrencyAmount } from 'utils/formatCurrencyAmount' import { useV3PositionFees } from 'hooks/useV3PositionFees' @@ -503,12 +503,12 @@ export function PositionPage({ hash={collectMigrationHash ?? ''} content={() => ( Claim fees} onDismiss={() => setShowConfirm(false)} topContent={modalHeader} /> )} - pendingText={t`Collecting fees`} + pendingText={Collecting fees} /> diff --git a/src/pages/RemoveLiquidity/V3.tsx b/src/pages/RemoveLiquidity/V3.tsx index d6ad772b12..89b4d6c7ac 100644 --- a/src/pages/RemoveLiquidity/V3.tsx +++ b/src/pages/RemoveLiquidity/V3.tsx @@ -261,7 +261,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) { hash={txnHash ?? ''} content={() => ( Remove Liquidity} onDismiss={handleDismissConfirmation} topContent={modalHeader} /> diff --git a/src/pages/RemoveLiquidity/index.tsx b/src/pages/RemoveLiquidity/index.tsx index 6ca59243ad..6aba947b1a 100644 --- a/src/pages/RemoveLiquidity/index.tsx +++ b/src/pages/RemoveLiquidity/index.tsx @@ -432,7 +432,7 @@ export default function RemoveLiquidity({ hash={txHash ? txHash : ''} content={() => ( You will receive} onDismiss={handleDismissConfirmation} topContent={modalHeader} bottomContent={modalBottom} diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 1f9005b603..a4819ef796 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -55,7 +55,7 @@ import { isTradeBetter } from '../../utils/isTradeBetter' import { maxAmountSpend } from '../../utils/maxAmountSpend' import { warningSeverity } from '../../utils/prices' import AppBody from '../AppBody' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' const StyledInfo = styled(Info)` opacity: 0.4; @@ -377,7 +377,9 @@ export default function Swap({ history }: RouteComponentProps) {
From (at most) : From + } value={formattedAmounts[Field.INPUT]} showMaxButton={showMaxButton} currency={currencies[Field.INPUT]} @@ -402,7 +404,7 @@ export default function Swap({ history }: RouteComponentProps) { To (at least) : To} showMaxButton={false} hideBalance={false} fiatValue={fiatValueOutput ?? undefined} @@ -572,9 +574,12 @@ export default function Swap({ history }: RouteComponentProps) { ) : ( + You must give the Uniswap smart contracts permission to use your{' '} + {currencies[Field.INPUT]?.symbol}. You only have to do this once per token. + + } > diff --git a/src/pages/Vote/VotePage.tsx b/src/pages/Vote/VotePage.tsx index 3a88a76e8a..9f55f8aec6 100644 --- a/src/pages/Vote/VotePage.tsx +++ b/src/pages/Vote/VotePage.tsx @@ -201,7 +201,7 @@ export default function VotePage({ return ( - + Unlock Votes} /> diff --git a/src/pages/Vote/index.tsx b/src/pages/Vote/index.tsx index 750a2c30c7..e2856403c0 100644 --- a/src/pages/Vote/index.tsx +++ b/src/pages/Vote/index.tsx @@ -29,7 +29,7 @@ import Loader from '../../components/Loader' import FormattedCurrencyAmount from '../../components/FormattedCurrencyAmount' import { useModalOpen, useToggleDelegateModal } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/actions' -import { t, Trans } from '@lingui/macro' +import { Trans } from '@lingui/macro' const PageWrapper = styled(AutoColumn)`` @@ -139,7 +139,7 @@ export default function Vote() { Unlock Votes : Update Delegation} />