use trans macro instead of t wherever possible
This commit is contained in:
parent
499ef27722
commit
1104bdcefc
@ -4,7 +4,7 @@ import Badge, { BadgeVariant } from 'components/Badge'
|
|||||||
import styled from 'styled-components/macro'
|
import styled from 'styled-components/macro'
|
||||||
|
|
||||||
import { MouseoverTooltip } from '../../components/Tooltip'
|
import { MouseoverTooltip } from '../../components/Tooltip'
|
||||||
import { Trans, t } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
import { AlertCircle } from 'react-feather'
|
import { AlertCircle } from 'react-feather'
|
||||||
|
|
||||||
const BadgeWrapper = styled.div`
|
const BadgeWrapper = styled.div`
|
||||||
@ -43,7 +43,7 @@ export default function RangeBadge({
|
|||||||
return (
|
return (
|
||||||
<BadgeWrapper>
|
<BadgeWrapper>
|
||||||
{removed ? (
|
{removed ? (
|
||||||
<MouseoverTooltip text={t`Your position has 0 liquidity, and is not earning fees.`}>
|
<MouseoverTooltip text={<Trans>Your position has 0 liquidity, and is not earning fees.</Trans>}>
|
||||||
<Badge variant={BadgeVariant.DEFAULT}>
|
<Badge variant={BadgeVariant.DEFAULT}>
|
||||||
<AlertCircle width={14} height={14} />
|
<AlertCircle width={14} height={14} />
|
||||||
|
|
||||||
@ -54,7 +54,11 @@ export default function RangeBadge({
|
|||||||
</MouseoverTooltip>
|
</MouseoverTooltip>
|
||||||
) : inRange ? (
|
) : inRange ? (
|
||||||
<MouseoverTooltip
|
<MouseoverTooltip
|
||||||
text={t`The price of this pool is within your selected range. Your position is currently earning fees.`}
|
text={
|
||||||
|
<Trans>
|
||||||
|
The price of this pool is within your selected range. Your position is currently earning fees.
|
||||||
|
</Trans>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Badge variant={BadgeVariant.DEFAULT}>
|
<Badge variant={BadgeVariant.DEFAULT}>
|
||||||
<ActiveDot />
|
<ActiveDot />
|
||||||
@ -65,7 +69,11 @@ export default function RangeBadge({
|
|||||||
</MouseoverTooltip>
|
</MouseoverTooltip>
|
||||||
) : (
|
) : (
|
||||||
<MouseoverTooltip
|
<MouseoverTooltip
|
||||||
text={t`The price of this pool is outside of your selected range. Your position is not currently earning fees.`}
|
text={
|
||||||
|
<Trans>
|
||||||
|
The price of this pool is outside of your selected range. Your position is not currently earning fees.
|
||||||
|
</Trans>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Badge variant={BadgeVariant.WARNING}>
|
<Badge variant={BadgeVariant.WARNING}>
|
||||||
<AlertCircle width={14} height={14} />
|
<AlertCircle width={14} height={14} />
|
||||||
|
@ -149,7 +149,7 @@ interface CurrencyInputPanelProps {
|
|||||||
onUserInput: (value: string) => void
|
onUserInput: (value: string) => void
|
||||||
onMax?: () => void
|
onMax?: () => void
|
||||||
showMaxButton: boolean
|
showMaxButton: boolean
|
||||||
label?: string
|
label?: ReactNode
|
||||||
onCurrencySelect?: (currency: Currency) => void
|
onCurrencySelect?: (currency: Currency) => void
|
||||||
currency?: Currency | null
|
currency?: Currency | null
|
||||||
hideBalance?: boolean
|
hideBalance?: boolean
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { FeeAmount } from '@uniswap/v3-sdk'
|
import { FeeAmount } from '@uniswap/v3-sdk'
|
||||||
import { t } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
import { AutoColumn } from 'components/Column'
|
import { AutoColumn } from 'components/Column'
|
||||||
import { DynamicSection } from 'pages/AddLiquidity/styled'
|
import { DynamicSection } from 'pages/AddLiquidity/styled'
|
||||||
import { TYPE } from 'theme'
|
import { TYPE } from 'theme'
|
||||||
@ -26,9 +26,11 @@ export default function FeeSelector({
|
|||||||
return (
|
return (
|
||||||
<AutoColumn gap="16px">
|
<AutoColumn gap="16px">
|
||||||
<DynamicSection gap="md" disabled={disabled}>
|
<DynamicSection gap="md" disabled={disabled}>
|
||||||
<TYPE.label>{t`Select Pool`}</TYPE.label>
|
<TYPE.label>
|
||||||
|
<Trans>Select Pool</Trans>
|
||||||
|
</TYPE.label>
|
||||||
<TYPE.main fontSize={14} fontWeight={400} style={{ marginBottom: '.5rem', lineHeight: '125%' }}>
|
<TYPE.main fontSize={14} fontWeight={400} style={{ marginBottom: '.5rem', lineHeight: '125%' }}>
|
||||||
{t`Select a pool type based on your preferred liquidity provider fee.`}
|
<Trans>Select a pool type based on your preferred liquidity provider fee.</Trans>
|
||||||
</TYPE.main>
|
</TYPE.main>
|
||||||
<RowBetween>
|
<RowBetween>
|
||||||
<ButtonRadioChecked
|
<ButtonRadioChecked
|
||||||
@ -37,9 +39,11 @@ export default function FeeSelector({
|
|||||||
onClick={() => handleFeePoolSelect(FeeAmount.LOW)}
|
onClick={() => handleFeePoolSelect(FeeAmount.LOW)}
|
||||||
>
|
>
|
||||||
<AutoColumn gap="sm" justify="flex-start">
|
<AutoColumn gap="sm" justify="flex-start">
|
||||||
<ResponsiveText>{t`0.05% fee`}</ResponsiveText>
|
<ResponsiveText>
|
||||||
|
<Trans>0.05% fee</Trans>
|
||||||
|
</ResponsiveText>
|
||||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||||
{t`Best for stable pairs.`}
|
<Trans>Best for stable pairs.</Trans>
|
||||||
</TYPE.main>
|
</TYPE.main>
|
||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</ButtonRadioChecked>
|
</ButtonRadioChecked>
|
||||||
@ -49,9 +53,11 @@ export default function FeeSelector({
|
|||||||
onClick={() => handleFeePoolSelect(FeeAmount.MEDIUM)}
|
onClick={() => handleFeePoolSelect(FeeAmount.MEDIUM)}
|
||||||
>
|
>
|
||||||
<AutoColumn gap="sm" justify="flex-start">
|
<AutoColumn gap="sm" justify="flex-start">
|
||||||
<ResponsiveText>{t`0.3% fee`}</ResponsiveText>
|
<ResponsiveText>
|
||||||
|
<Trans>0.3% fee</Trans>
|
||||||
|
</ResponsiveText>
|
||||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||||
{t`Best for most pairs.`}
|
<Trans>Best for most pairs.</Trans>
|
||||||
</TYPE.main>
|
</TYPE.main>
|
||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</ButtonRadioChecked>
|
</ButtonRadioChecked>
|
||||||
@ -61,9 +67,11 @@ export default function FeeSelector({
|
|||||||
onClick={() => handleFeePoolSelect(FeeAmount.HIGH)}
|
onClick={() => handleFeePoolSelect(FeeAmount.HIGH)}
|
||||||
>
|
>
|
||||||
<AutoColumn gap="sm" justify="flex-start">
|
<AutoColumn gap="sm" justify="flex-start">
|
||||||
<ResponsiveText>{t`1% fee`}</ResponsiveText>
|
<ResponsiveText>
|
||||||
|
<Trans>1% fee</Trans>
|
||||||
|
</ResponsiveText>
|
||||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||||
{t`Best for exotic pairs.`}
|
<Trans>Best for exotic pairs.</Trans>
|
||||||
</TYPE.main>
|
</TYPE.main>
|
||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</ButtonRadioChecked>
|
</ButtonRadioChecked>
|
||||||
|
@ -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 { Position } from '@uniswap/v3-sdk'
|
||||||
import { LightCard } from 'components/Card'
|
import { LightCard } from 'components/Card'
|
||||||
import { AutoColumn } from 'components/Column'
|
import { AutoColumn } from 'components/Column'
|
||||||
@ -22,7 +22,7 @@ export const PositionPreview = ({
|
|||||||
baseCurrencyDefault,
|
baseCurrencyDefault,
|
||||||
}: {
|
}: {
|
||||||
position: Position
|
position: Position
|
||||||
title?: string
|
title?: ReactNode
|
||||||
inRange: boolean
|
inRange: boolean
|
||||||
baseCurrencyDefault?: Currency | undefined
|
baseCurrencyDefault?: Currency | undefined
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useState } from 'react'
|
import React, { ReactNode, useCallback, useState } from 'react'
|
||||||
import styled from 'styled-components/macro'
|
import styled from 'styled-components/macro'
|
||||||
import Tooltip from '../Tooltip'
|
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`
|
const QuestionMark = styled.span`
|
||||||
font-size: 14px;
|
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<boolean>(false)
|
const [show, setShow] = useState<boolean>(false)
|
||||||
|
|
||||||
const open = useCallback(() => setShow(true), [setShow])
|
const open = useCallback(() => setShow(true), [setShow])
|
||||||
@ -65,20 +44,3 @@ export default function QuestionHelper({ text }: { text: string; size?: number }
|
|||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LightQuestionHelper({ text }: { text: string }) {
|
|
||||||
const [show, setShow] = useState<boolean>(false)
|
|
||||||
|
|
||||||
const open = useCallback(() => setShow(true), [setShow])
|
|
||||||
const close = useCallback(() => setShow(false), [setShow])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<span style={{ marginLeft: 4 }}>
|
|
||||||
<Tooltip text={text} show={show}>
|
|
||||||
<LightQuestionWrapper onClick={open} onMouseEnter={open} onMouseLeave={close}>
|
|
||||||
<QuestionMark>?</QuestionMark>
|
|
||||||
</LightQuestionWrapper>
|
|
||||||
</Tooltip>
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Text } from 'rebass'
|
import { Text } from 'rebass'
|
||||||
import { Currency } from '@uniswap/sdk-core'
|
import { Currency } from '@uniswap/sdk-core'
|
||||||
@ -44,7 +44,7 @@ export default function CommonBases({
|
|||||||
<Text fontWeight={500} fontSize={14}>
|
<Text fontWeight={500} fontSize={14}>
|
||||||
<Trans>Common bases</Trans>
|
<Trans>Common bases</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
<QuestionHelper text={t`These tokens are commonly paired with other tokens.`} />
|
<QuestionHelper text={<Trans>These tokens are commonly paired with other tokens.</Trans>} />
|
||||||
</AutoRow>
|
</AutoRow>
|
||||||
<AutoRow gap="4px">
|
<AutoRow gap="4px">
|
||||||
{bases.map((currency: Currency) => {
|
{bases.map((currency: Currency) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
|
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
|
||||||
import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
|
import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
|
||||||
import { FixedSizeList } from 'react-window'
|
import { FixedSizeList } from 'react-window'
|
||||||
@ -133,7 +133,11 @@ function CurrencyRow({
|
|||||||
{currency.symbol}
|
{currency.symbol}
|
||||||
</Text>
|
</Text>
|
||||||
<TYPE.darkGray ml="0px" fontSize={'12px'} fontWeight={300}>
|
<TYPE.darkGray ml="0px" fontSize={'12px'} fontWeight={300}>
|
||||||
{currency.name} {!currency.isNative && !isOnSelectedList && customAdded && '• ' + t`Added by user`}
|
{!currency.isNative && !isOnSelectedList && customAdded ? (
|
||||||
|
<Trans>{currency.name} • Added by user</Trans>
|
||||||
|
) : (
|
||||||
|
currency.name
|
||||||
|
)}
|
||||||
</TYPE.darkGray>
|
</TYPE.darkGray>
|
||||||
</Column>
|
</Column>
|
||||||
<TokenTags currency={currency} />
|
<TokenTags currency={currency} />
|
||||||
@ -163,7 +167,11 @@ function BreakLineComponent({ style }: { style: CSSProperties }) {
|
|||||||
</TYPE.main>
|
</TYPE.main>
|
||||||
</RowFixed>
|
</RowFixed>
|
||||||
<QuestionHelper
|
<QuestionHelper
|
||||||
text={t`Tokens from inactive lists. Import specific tokens below or click 'Manage' to activate more lists.`}
|
text={
|
||||||
|
<Trans>
|
||||||
|
Tokens from inactive lists. Import specific tokens below or click Manage to activate more lists.
|
||||||
|
</Trans>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</RowBetween>
|
</RowBetween>
|
||||||
</LightGreyCard>
|
</LightGreyCard>
|
||||||
|
@ -199,7 +199,9 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
|
|||||||
<Trans>Toggle Expert Mode</Trans>
|
<Trans>Toggle Expert Mode</Trans>
|
||||||
</TYPE.black>
|
</TYPE.black>
|
||||||
<QuestionHelper
|
<QuestionHelper
|
||||||
text={t`Allow high price impact trades and skip the confirm screen. Use at your own risk.`}
|
text={
|
||||||
|
<Trans>Allow high price impact trades and skip the confirm screen. Use at your own risk.</Trans>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</RowFixed>
|
</RowFixed>
|
||||||
<Toggle
|
<Toggle
|
||||||
@ -223,7 +225,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
|
|||||||
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
|
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
|
||||||
<Trans>Disable Multihops</Trans>
|
<Trans>Disable Multihops</Trans>
|
||||||
</TYPE.black>
|
</TYPE.black>
|
||||||
<QuestionHelper text={t`Restricts swaps to direct pairs only.`} />
|
<QuestionHelper text={<Trans>Restricts swaps to direct pairs only.</Trans>} />
|
||||||
</RowFixed>
|
</RowFixed>
|
||||||
<Toggle
|
<Toggle
|
||||||
id="toggle-disable-multihop-button"
|
id="toggle-disable-multihop-button"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useState } from 'react'
|
import React, { ReactNode, useCallback, useState } from 'react'
|
||||||
import styled from 'styled-components/macro'
|
import styled from 'styled-components/macro'
|
||||||
import Popover, { PopoverProps } from '../Popover'
|
import Popover, { PopoverProps } from '../Popover'
|
||||||
|
|
||||||
@ -10,11 +10,11 @@ const TooltipContainer = styled.div`
|
|||||||
`
|
`
|
||||||
|
|
||||||
interface TooltipProps extends Omit<PopoverProps, 'content'> {
|
interface TooltipProps extends Omit<PopoverProps, 'content'> {
|
||||||
text: string
|
text: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TooltipContentProps extends Omit<PopoverProps, 'content'> {
|
interface TooltipContentProps extends Omit<PopoverProps, 'content'> {
|
||||||
content: React.ReactNode
|
content: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Tooltip({ text, ...rest }: TooltipProps) {
|
export default function Tooltip({ text, ...rest }: TooltipProps) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Currency } from '@uniswap/sdk-core'
|
import { Currency } from '@uniswap/sdk-core'
|
||||||
import React, { useContext } from 'react'
|
import React, { ReactNode, useContext } from 'react'
|
||||||
import styled, { ThemeContext } from 'styled-components'
|
import styled, { ThemeContext } from 'styled-components'
|
||||||
import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink'
|
import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink'
|
||||||
import Modal from '../Modal'
|
import Modal from '../Modal'
|
||||||
@ -45,7 +45,7 @@ export function ConfirmationPendingContent({
|
|||||||
inline,
|
inline,
|
||||||
}: {
|
}: {
|
||||||
onDismiss: () => void
|
onDismiss: () => void
|
||||||
pendingText: string
|
pendingText: ReactNode
|
||||||
inline?: boolean // not in modal
|
inline?: boolean // not in modal
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
@ -153,10 +153,10 @@ export function ConfirmationModalContent({
|
|||||||
onDismiss,
|
onDismiss,
|
||||||
topContent,
|
topContent,
|
||||||
}: {
|
}: {
|
||||||
title: string
|
title: ReactNode
|
||||||
onDismiss: () => void
|
onDismiss: () => void
|
||||||
topContent: () => React.ReactNode
|
topContent: () => ReactNode
|
||||||
bottomContent?: () => React.ReactNode | undefined
|
bottomContent?: () => ReactNode | undefined
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
@ -212,7 +212,7 @@ interface ConfirmationModalProps {
|
|||||||
hash: string | undefined
|
hash: string | undefined
|
||||||
content: () => React.ReactNode
|
content: () => React.ReactNode
|
||||||
attemptingTxn: boolean
|
attemptingTxn: boolean
|
||||||
pendingText: string
|
pendingText: React.ReactNode
|
||||||
currencyToAdd?: Currency | undefined
|
currencyToAdd?: Currency | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,9 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
|||||||
<Trans>Slippage tolerance</Trans>
|
<Trans>Slippage tolerance</Trans>
|
||||||
</TYPE.black>
|
</TYPE.black>
|
||||||
<QuestionHelper
|
<QuestionHelper
|
||||||
text={t`Your transaction will revert if the price changes unfavorably by more than this percentage.`}
|
text={
|
||||||
|
<Trans>Your transaction will revert if the price changes unfavorably by more than this percentage.</Trans>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</RowFixed>
|
</RowFixed>
|
||||||
<RowBetween>
|
<RowBetween>
|
||||||
@ -208,11 +210,13 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
|||||||
color: slippageError ? 'red' : '#F3841E',
|
color: slippageError ? 'red' : '#F3841E',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{slippageError
|
{slippageError ? (
|
||||||
? t`Enter a valid slippage percentage`
|
<Trans>Enter a valid slippage percentage</Trans>
|
||||||
: tooLow
|
) : tooLow ? (
|
||||||
? t`Your transaction may fail`
|
<Trans>Your transaction may fail</Trans>
|
||||||
: t`Your transaction may be frontrun`}
|
) : (
|
||||||
|
<Trans>Your transaction may be frontrun</Trans>
|
||||||
|
)}
|
||||||
</RowBetween>
|
</RowBetween>
|
||||||
) : null}
|
) : null}
|
||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
|
@ -16,7 +16,7 @@ import { ApplicationModal } from '../../state/application/actions'
|
|||||||
import { useModalOpen, useWalletModalToggle } from '../../state/application/hooks'
|
import { useModalOpen, useWalletModalToggle } from '../../state/application/hooks'
|
||||||
import { ExternalLink, TYPE } from '../../theme'
|
import { ExternalLink, TYPE } from '../../theme'
|
||||||
import AccountDetails from '../AccountDetails'
|
import AccountDetails from '../AccountDetails'
|
||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
|
|
||||||
import Modal from '../Modal'
|
import Modal from '../Modal'
|
||||||
import Option from './Option'
|
import Option from './Option'
|
||||||
@ -240,7 +240,7 @@ export default function WalletModal({
|
|||||||
id={`connect-${key}`}
|
id={`connect-${key}`}
|
||||||
key={key}
|
key={key}
|
||||||
color={'#E8831D'}
|
color={'#E8831D'}
|
||||||
header={t`Install Metamask`}
|
header={<Trans>Install Metamask</Trans>}
|
||||||
subheader={null}
|
subheader={null}
|
||||||
link={'https://metamask.io/'}
|
link={'https://metamask.io/'}
|
||||||
icon={MetamaskIcon}
|
icon={MetamaskIcon}
|
||||||
|
@ -204,7 +204,7 @@ function Web3StatusInner() {
|
|||||||
return (
|
return (
|
||||||
<Web3StatusError onClick={toggleWalletModal}>
|
<Web3StatusError onClick={toggleWalletModal}>
|
||||||
<NetworkIcon />
|
<NetworkIcon />
|
||||||
<Text>{error instanceof UnsupportedChainIdError ? t`Wrong Network` : t`Error`}</Text>
|
<Text>{error instanceof UnsupportedChainIdError ? <Trans>Wrong Network</Trans> : <Trans>Error</Trans>}</Text>
|
||||||
</Web3StatusError>
|
</Web3StatusError>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { ReactNode, useState } from 'react'
|
||||||
import { UNI } from '../../constants/tokens'
|
import { UNI } from '../../constants/tokens'
|
||||||
|
|
||||||
import Modal from '../Modal'
|
import Modal from '../Modal'
|
||||||
@ -38,7 +38,7 @@ const TextButton = styled.div`
|
|||||||
interface VoteModalProps {
|
interface VoteModalProps {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
onDismiss: () => void
|
onDismiss: () => void
|
||||||
title: string
|
title: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalProps) {
|
export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalProps) {
|
||||||
|
@ -473,7 +473,11 @@ export default function AddLiquidity({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{hasExistingPosition && existingPosition ? (
|
{hasExistingPosition && existingPosition ? (
|
||||||
<PositionPreview position={existingPosition} title={t`Selected Range`} inRange={!outOfRange} />
|
<PositionPreview
|
||||||
|
position={existingPosition}
|
||||||
|
title={<Trans>Selected Range</Trans>}
|
||||||
|
inRange={!outOfRange}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<FeeSelector
|
<FeeSelector
|
||||||
|
@ -320,7 +320,7 @@ export default function AddLiquidity({
|
|||||||
hash={txHash}
|
hash={txHash}
|
||||||
content={() => (
|
content={() => (
|
||||||
<ConfirmationModalContent
|
<ConfirmationModalContent
|
||||||
title={noLiquidity ? t`You are creating a pool` : t`You will receive`}
|
title={noLiquidity ? <Trans>You are creating a pool</Trans> : <Trans>You will receive</Trans>}
|
||||||
onDismiss={handleDismissConfirmation}
|
onDismiss={handleDismissConfirmation}
|
||||||
topContent={modalHeader}
|
topContent={modalHeader}
|
||||||
bottomContent={modalBottom}
|
bottomContent={modalBottom}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import JSBI from 'jsbi'
|
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 { Fraction, Percent, Price, Token, CurrencyAmount, WETH9 } from '@uniswap/sdk-core'
|
||||||
import { FACTORY_ADDRESS } from '@uniswap/v2-sdk'
|
import { FACTORY_ADDRESS } from '@uniswap/v2-sdk'
|
||||||
import { Redirect, RouteComponentProps } from 'react-router'
|
import { Redirect, RouteComponentProps } from 'react-router'
|
||||||
@ -34,7 +34,7 @@ import { TransactionResponse } from '@ethersproject/providers'
|
|||||||
import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks'
|
import { useIsTransactionPending, useTransactionAdder } from 'state/transactions/hooks'
|
||||||
import { useV3DerivedMintInfo, useRangeHopCallbacks, useV3MintActionHandlers } from 'state/mint/v3/hooks'
|
import { useV3DerivedMintInfo, useRangeHopCallbacks, useV3MintActionHandlers } from 'state/mint/v3/hooks'
|
||||||
import { Bound, resetMintState } from 'state/mint/v3/actions'
|
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 { AlertCircle, AlertTriangle, ArrowDown } from 'react-feather'
|
||||||
import FeeSelector from 'components/FeeSelector'
|
import FeeSelector from 'components/FeeSelector'
|
||||||
import RangeSelector from 'components/RangeSelector'
|
import RangeSelector from 'components/RangeSelector'
|
||||||
@ -54,7 +54,7 @@ const ZERO = JSBI.BigInt(0)
|
|||||||
|
|
||||||
const DEFAULT_MIGRATE_SLIPPAGE_TOLERANCE = new Percent(75, 10_000)
|
const DEFAULT_MIGRATE_SLIPPAGE_TOLERANCE = new Percent(75, 10_000)
|
||||||
|
|
||||||
function EmptyState({ message }: { message: string }) {
|
function EmptyState({ message }: { message: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<AutoColumn style={{ minHeight: 200, justifyContent: 'center', alignItems: 'center' }}>
|
<AutoColumn style={{ minHeight: 200, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
<TYPE.body>{message}</TYPE.body>
|
<TYPE.body>{message}</TYPE.body>
|
||||||
@ -750,7 +750,7 @@ export default function MigrateV2Pair({
|
|||||||
token1={token1}
|
token1={token1}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<EmptyState message={t`Loading`} />
|
<EmptyState message={<Trans>Loading</Trans>} />
|
||||||
)}
|
)}
|
||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</BodyWrapper>
|
</BodyWrapper>
|
||||||
|
@ -18,7 +18,7 @@ import MigrateSushiPositionCard from 'components/PositionCard/Sushi'
|
|||||||
import { PairState, useV2Pairs } from 'hooks/useV2Pairs'
|
import { PairState, useV2Pairs } from 'hooks/useV2Pairs'
|
||||||
import { getCreate2Address } from '@ethersproject/address'
|
import { getCreate2Address } from '@ethersproject/address'
|
||||||
import { pack, keccak256 } from '@ethersproject/solidity'
|
import { pack, keccak256 } from '@ethersproject/solidity'
|
||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
|
|
||||||
function EmptyState({ message }: { message: ReactNode }) {
|
function EmptyState({ message }: { message: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
@ -115,7 +115,7 @@ export default function MigrateV2() {
|
|||||||
<Trans>Migrate V2 Liquidity</Trans>
|
<Trans>Migrate V2 Liquidity</Trans>
|
||||||
</TYPE.mediumHeader>
|
</TYPE.mediumHeader>
|
||||||
<div>
|
<div>
|
||||||
<QuestionHelper text={t`Migrate your liquidity tokens from Uniswap V2 to Uniswap V3.`} />
|
<QuestionHelper text={<Trans>Migrate your liquidity tokens from Uniswap V2 to Uniswap V3.</Trans>} />
|
||||||
</div>
|
</div>
|
||||||
</AutoRow>
|
</AutoRow>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import Badge from 'components/Badge'
|
|||||||
import { ButtonConfirmed, ButtonPrimary, ButtonGray } from 'components/Button'
|
import { ButtonConfirmed, ButtonPrimary, ButtonGray } from 'components/Button'
|
||||||
import { DarkCard, LightCard } from 'components/Card'
|
import { DarkCard, LightCard } from 'components/Card'
|
||||||
import CurrencyLogo from 'components/CurrencyLogo'
|
import CurrencyLogo from 'components/CurrencyLogo'
|
||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
import { currencyId } from 'utils/currencyId'
|
import { currencyId } from 'utils/currencyId'
|
||||||
import { formatCurrencyAmount } from 'utils/formatCurrencyAmount'
|
import { formatCurrencyAmount } from 'utils/formatCurrencyAmount'
|
||||||
import { useV3PositionFees } from 'hooks/useV3PositionFees'
|
import { useV3PositionFees } from 'hooks/useV3PositionFees'
|
||||||
@ -503,12 +503,12 @@ export function PositionPage({
|
|||||||
hash={collectMigrationHash ?? ''}
|
hash={collectMigrationHash ?? ''}
|
||||||
content={() => (
|
content={() => (
|
||||||
<ConfirmationModalContent
|
<ConfirmationModalContent
|
||||||
title={t`Claim fees`}
|
title={<Trans>Claim fees</Trans>}
|
||||||
onDismiss={() => setShowConfirm(false)}
|
onDismiss={() => setShowConfirm(false)}
|
||||||
topContent={modalHeader}
|
topContent={modalHeader}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
pendingText={t`Collecting fees`}
|
pendingText={<Trans>Collecting fees</Trans>}
|
||||||
/>
|
/>
|
||||||
<AutoColumn gap="md">
|
<AutoColumn gap="md">
|
||||||
<AutoColumn gap="sm">
|
<AutoColumn gap="sm">
|
||||||
|
@ -261,7 +261,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) {
|
|||||||
hash={txnHash ?? ''}
|
hash={txnHash ?? ''}
|
||||||
content={() => (
|
content={() => (
|
||||||
<ConfirmationModalContent
|
<ConfirmationModalContent
|
||||||
title={t`Remove Liquidity`}
|
title={<Trans>Remove Liquidity</Trans>}
|
||||||
onDismiss={handleDismissConfirmation}
|
onDismiss={handleDismissConfirmation}
|
||||||
topContent={modalHeader}
|
topContent={modalHeader}
|
||||||
/>
|
/>
|
||||||
|
@ -432,7 +432,7 @@ export default function RemoveLiquidity({
|
|||||||
hash={txHash ? txHash : ''}
|
hash={txHash ? txHash : ''}
|
||||||
content={() => (
|
content={() => (
|
||||||
<ConfirmationModalContent
|
<ConfirmationModalContent
|
||||||
title={t`You will receive`}
|
title={<Trans>You will receive</Trans>}
|
||||||
onDismiss={handleDismissConfirmation}
|
onDismiss={handleDismissConfirmation}
|
||||||
topContent={modalHeader}
|
topContent={modalHeader}
|
||||||
bottomContent={modalBottom}
|
bottomContent={modalBottom}
|
||||||
|
@ -55,7 +55,7 @@ import { isTradeBetter } from '../../utils/isTradeBetter'
|
|||||||
import { maxAmountSpend } from '../../utils/maxAmountSpend'
|
import { maxAmountSpend } from '../../utils/maxAmountSpend'
|
||||||
import { warningSeverity } from '../../utils/prices'
|
import { warningSeverity } from '../../utils/prices'
|
||||||
import AppBody from '../AppBody'
|
import AppBody from '../AppBody'
|
||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
|
|
||||||
const StyledInfo = styled(Info)`
|
const StyledInfo = styled(Info)`
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
@ -377,7 +377,9 @@ export default function Swap({ history }: RouteComponentProps) {
|
|||||||
<AutoColumn gap={'md'}>
|
<AutoColumn gap={'md'}>
|
||||||
<div style={{ display: 'relative' }}>
|
<div style={{ display: 'relative' }}>
|
||||||
<CurrencyInputPanel
|
<CurrencyInputPanel
|
||||||
label={independentField === Field.OUTPUT && !showWrap ? t`From (at most)` : t`From`}
|
label={
|
||||||
|
independentField === Field.OUTPUT && !showWrap ? <Trans>From (at most)</Trans> : <Trans>From</Trans>
|
||||||
|
}
|
||||||
value={formattedAmounts[Field.INPUT]}
|
value={formattedAmounts[Field.INPUT]}
|
||||||
showMaxButton={showMaxButton}
|
showMaxButton={showMaxButton}
|
||||||
currency={currencies[Field.INPUT]}
|
currency={currencies[Field.INPUT]}
|
||||||
@ -402,7 +404,7 @@ export default function Swap({ history }: RouteComponentProps) {
|
|||||||
<CurrencyInputPanel
|
<CurrencyInputPanel
|
||||||
value={formattedAmounts[Field.OUTPUT]}
|
value={formattedAmounts[Field.OUTPUT]}
|
||||||
onUserInput={handleTypeOutput}
|
onUserInput={handleTypeOutput}
|
||||||
label={independentField === Field.INPUT && !showWrap ? t`To (at least)` : t`To`}
|
label={independentField === Field.INPUT && !showWrap ? <Trans>To (at least)</Trans> : <Trans>To</Trans>}
|
||||||
showMaxButton={false}
|
showMaxButton={false}
|
||||||
hideBalance={false}
|
hideBalance={false}
|
||||||
fiatValue={fiatValueOutput ?? undefined}
|
fiatValue={fiatValueOutput ?? undefined}
|
||||||
@ -572,9 +574,12 @@ export default function Swap({ history }: RouteComponentProps) {
|
|||||||
<CheckCircle size="20" color={theme.green1} />
|
<CheckCircle size="20" color={theme.green1} />
|
||||||
) : (
|
) : (
|
||||||
<MouseoverTooltip
|
<MouseoverTooltip
|
||||||
text={t`You must give the Uniswap smart contracts permission to use your ${
|
text={
|
||||||
currencies[Field.INPUT]?.symbol
|
<Trans>
|
||||||
}. You only have to do this once per token.`}
|
You must give the Uniswap smart contracts permission to use your{' '}
|
||||||
|
{currencies[Field.INPUT]?.symbol}. You only have to do this once per token.
|
||||||
|
</Trans>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<HelpCircle size="20" color={'white'} style={{ marginLeft: '8px' }} />
|
<HelpCircle size="20" color={'white'} style={{ marginLeft: '8px' }} />
|
||||||
</MouseoverTooltip>
|
</MouseoverTooltip>
|
||||||
|
@ -201,7 +201,7 @@ export default function VotePage({
|
|||||||
return (
|
return (
|
||||||
<PageWrapper gap="lg" justify="center">
|
<PageWrapper gap="lg" justify="center">
|
||||||
<VoteModal isOpen={showVoteModal} onDismiss={toggleVoteModal} proposalId={proposalData?.id} support={support} />
|
<VoteModal isOpen={showVoteModal} onDismiss={toggleVoteModal} proposalId={proposalData?.id} support={support} />
|
||||||
<DelegateModal isOpen={showDelegateModal} onDismiss={toggleDelegateModal} title={t`Unlock Votes`} />
|
<DelegateModal isOpen={showDelegateModal} onDismiss={toggleDelegateModal} title={<Trans>Unlock Votes</Trans>} />
|
||||||
<ProposalInfo gap="lg" justify="start">
|
<ProposalInfo gap="lg" justify="start">
|
||||||
<RowBetween style={{ width: '100%' }}>
|
<RowBetween style={{ width: '100%' }}>
|
||||||
<ArrowWrapper to="/vote">
|
<ArrowWrapper to="/vote">
|
||||||
|
@ -29,7 +29,7 @@ import Loader from '../../components/Loader'
|
|||||||
import FormattedCurrencyAmount from '../../components/FormattedCurrencyAmount'
|
import FormattedCurrencyAmount from '../../components/FormattedCurrencyAmount'
|
||||||
import { useModalOpen, useToggleDelegateModal } from '../../state/application/hooks'
|
import { useModalOpen, useToggleDelegateModal } from '../../state/application/hooks'
|
||||||
import { ApplicationModal } from '../../state/application/actions'
|
import { ApplicationModal } from '../../state/application/actions'
|
||||||
import { t, Trans } from '@lingui/macro'
|
import { Trans } from '@lingui/macro'
|
||||||
|
|
||||||
const PageWrapper = styled(AutoColumn)``
|
const PageWrapper = styled(AutoColumn)``
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ export default function Vote() {
|
|||||||
<DelegateModal
|
<DelegateModal
|
||||||
isOpen={showDelegateModal}
|
isOpen={showDelegateModal}
|
||||||
onDismiss={toggleDelegateModal}
|
onDismiss={toggleDelegateModal}
|
||||||
title={showUnlockVoting ? t`Unlock Votes` : t`Update Delegation`}
|
title={showUnlockVoting ? <Trans>Unlock Votes</Trans> : <Trans>Update Delegation</Trans>}
|
||||||
/>
|
/>
|
||||||
<TopSection gap="md">
|
<TopSection gap="md">
|
||||||
<VoteCard>
|
<VoteCard>
|
||||||
|
Loading…
Reference in New Issue
Block a user