Commit 46f539c6 authored by Justin Domingue's avatar Justin Domingue Committed by GitHub

chore(i18n): wrapped English text around <Trans> component (#1714)

* feat(i18n): wrapped English text around <Trans> component

* cleanup

* synced

* regenerated locales
parent ad65b638
...@@ -4,6 +4,7 @@ import useCopyClipboard from '../../hooks/useCopyClipboard' ...@@ -4,6 +4,7 @@ import useCopyClipboard from '../../hooks/useCopyClipboard'
import { LinkStyledButton } from '../../theme' import { LinkStyledButton } from '../../theme'
import { CheckCircle, Copy } from 'react-feather' import { CheckCircle, Copy } from 'react-feather'
import { Trans } from '@lingui/macro'
const CopyIcon = styled(LinkStyledButton)` const CopyIcon = styled(LinkStyledButton)`
color: ${({ theme }) => theme.text3}; color: ${({ theme }) => theme.text3};
...@@ -33,7 +34,9 @@ export default function CopyHelper(props: { toCopy: string; children?: React.Rea ...@@ -33,7 +34,9 @@ export default function CopyHelper(props: { toCopy: string; children?: React.Rea
{isCopied ? ( {isCopied ? (
<TransactionStatusText> <TransactionStatusText>
<CheckCircle size={'16'} /> <CheckCircle size={'16'} />
<TransactionStatusText>Copied</TransactionStatusText> <TransactionStatusText>
<Trans id="common.copied">Copied</Trans>
</TransactionStatusText>
</TransactionStatusText> </TransactionStatusText>
) : ( ) : (
<TransactionStatusText> <TransactionStatusText>
......
...@@ -21,6 +21,7 @@ import Identicon from '../Identicon' ...@@ -21,6 +21,7 @@ import Identicon from '../Identicon'
import { ButtonSecondary } from '../Button' import { ButtonSecondary } from '../Button'
import { ExternalLink as LinkIcon } from 'react-feather' import { ExternalLink as LinkIcon } from 'react-feather'
import { ExternalLink, LinkStyledButton, TYPE } from '../../theme' import { ExternalLink, LinkStyledButton, TYPE } from '../../theme'
import { Trans } from '@lingui/macro'
const HeaderRow = styled.div` const HeaderRow = styled.div`
${({ theme }) => theme.flexRowNoWrap}; ${({ theme }) => theme.flexRowNoWrap};
...@@ -237,7 +238,11 @@ export default function AccountDetails({ ...@@ -237,7 +238,11 @@ export default function AccountDetails({
SUPPORTED_WALLETS[k].connector === connector && (connector !== injected || isMetaMask === (k === 'METAMASK')) SUPPORTED_WALLETS[k].connector === connector && (connector !== injected || isMetaMask === (k === 'METAMASK'))
) )
.map((k) => SUPPORTED_WALLETS[k].name)[0] .map((k) => SUPPORTED_WALLETS[k].name)[0]
return <WalletName>Connected with {name}</WalletName> return (
<WalletName>
<Trans id="wallet.connectedWith">Connected with {name}</Trans>
</WalletName>
)
} }
function getStatusIcon() { function getStatusIcon() {
...@@ -250,32 +255,32 @@ export default function AccountDetails({ ...@@ -250,32 +255,32 @@ export default function AccountDetails({
} else if (connector === walletconnect) { } else if (connector === walletconnect) {
return ( return (
<IconWrapper size={16}> <IconWrapper size={16}>
<img src={WalletConnectIcon} alt={'wallet connect logo'} /> <img src={WalletConnectIcon} alt={'WalletConnect logo'} />
</IconWrapper> </IconWrapper>
) )
} else if (connector === walletlink) { } else if (connector === walletlink) {
return ( return (
<IconWrapper size={16}> <IconWrapper size={16}>
<img src={CoinbaseWalletIcon} alt={'coinbase wallet logo'} /> <img src={CoinbaseWalletIcon} alt={'Coinbase Wallet logo'} />
</IconWrapper> </IconWrapper>
) )
} else if (connector === fortmatic) { } else if (connector === fortmatic) {
return ( return (
<IconWrapper size={16}> <IconWrapper size={16}>
<img src={FortmaticIcon} alt={'fortmatic logo'} /> <img src={FortmaticIcon} alt={'Fortmatic logo'} />
</IconWrapper> </IconWrapper>
) )
} else if (connector === portis) { } else if (connector === portis) {
return ( return (
<> <>
<IconWrapper size={16}> <IconWrapper size={16}>
<img src={PortisIcon} alt={'portis logo'} /> <img src={PortisIcon} alt={'Portis logo'} />
<MainWalletAction <MainWalletAction
onClick={() => { onClick={() => {
portis.portis.showPortis() portis.portis.showPortis()
}} }}
> >
Show Portis <Trans id="wallet.showPortis">Show Portis</Trans>
</MainWalletAction> </MainWalletAction>
</IconWrapper> </IconWrapper>
</> </>
...@@ -294,7 +299,9 @@ export default function AccountDetails({ ...@@ -294,7 +299,9 @@ export default function AccountDetails({
<CloseIcon onClick={toggleWalletModal}> <CloseIcon onClick={toggleWalletModal}>
<CloseColor /> <CloseColor />
</CloseIcon> </CloseIcon>
<HeaderRow>Account</HeaderRow> <HeaderRow>
<Trans id="wallet.account">Account</Trans>
</HeaderRow>
<AccountSection> <AccountSection>
<YourAccount> <YourAccount>
<InfoCard> <InfoCard>
...@@ -308,7 +315,7 @@ export default function AccountDetails({ ...@@ -308,7 +315,7 @@ export default function AccountDetails({
;(connector as any).close() ;(connector as any).close()
}} }}
> >
Disconnect <Trans id="wallet.disconnect">Disconnect</Trans>
</WalletAction> </WalletAction>
)} )}
<WalletAction <WalletAction
...@@ -317,7 +324,7 @@ export default function AccountDetails({ ...@@ -317,7 +324,7 @@ export default function AccountDetails({
openOptions() openOptions()
}} }}
> >
Change <Trans id="wallet.change">Change</Trans>
</WalletAction> </WalletAction>
</div> </div>
</AccountGroupingRow> </AccountGroupingRow>
...@@ -347,7 +354,9 @@ export default function AccountDetails({ ...@@ -347,7 +354,9 @@ export default function AccountDetails({
<div> <div>
{account && ( {account && (
<Copy toCopy={account}> <Copy toCopy={account}>
<span style={{ marginLeft: '4px' }}>Copy Address</span> <span style={{ marginLeft: '4px' }}>
<Trans id="wallet.copyAddress">Copy Address</Trans>
</span>
</Copy> </Copy>
)} )}
{chainId && account && ( {chainId && account && (
...@@ -357,7 +366,9 @@ export default function AccountDetails({ ...@@ -357,7 +366,9 @@ export default function AccountDetails({
href={getExplorerLink(chainId, ENSName, ExplorerDataType.ADDRESS)} href={getExplorerLink(chainId, ENSName, ExplorerDataType.ADDRESS)}
> >
<LinkIcon size={16} /> <LinkIcon size={16} />
<span style={{ marginLeft: '4px' }}>View on Etherscan</span> <span style={{ marginLeft: '4px' }}>
<Trans id="wallet.viewOnEtherscan">View on Etherscan</Trans>
</span>
</AddressLink> </AddressLink>
)} )}
</div> </div>
...@@ -369,7 +380,9 @@ export default function AccountDetails({ ...@@ -369,7 +380,9 @@ export default function AccountDetails({
<div> <div>
{account && ( {account && (
<Copy toCopy={account}> <Copy toCopy={account}>
<span style={{ marginLeft: '4px' }}>Copy Address</span> <span style={{ marginLeft: '4px' }}>
<Trans id="wallet.copyAddress">Copy Address</Trans>
</span>
</Copy> </Copy>
)} )}
{chainId && account && ( {chainId && account && (
...@@ -379,7 +392,9 @@ export default function AccountDetails({ ...@@ -379,7 +392,9 @@ export default function AccountDetails({
href={getExplorerLink(chainId, account, ExplorerDataType.ADDRESS)} href={getExplorerLink(chainId, account, ExplorerDataType.ADDRESS)}
> >
<LinkIcon size={16} /> <LinkIcon size={16} />
<span style={{ marginLeft: '4px' }}>View on Etherscan</span> <span style={{ marginLeft: '4px' }}>
<Trans id="wallet.viewOnEtherscan">View on Etherscan</Trans>
</span>
</AddressLink> </AddressLink>
)} )}
</div> </div>
...@@ -394,15 +409,21 @@ export default function AccountDetails({ ...@@ -394,15 +409,21 @@ export default function AccountDetails({
{!!pendingTransactions.length || !!confirmedTransactions.length ? ( {!!pendingTransactions.length || !!confirmedTransactions.length ? (
<LowerSection> <LowerSection>
<AutoRow mb={'1rem'} style={{ justifyContent: 'space-between' }}> <AutoRow mb={'1rem'} style={{ justifyContent: 'space-between' }}>
<TYPE.body>Recent Transactions</TYPE.body> <TYPE.body>
<LinkStyledButton onClick={clearAllTransactionsCallback}>(clear all)</LinkStyledButton> <Trans id="wallet.recentTransactions">Recent Transactions</Trans>
</TYPE.body>
<LinkStyledButton onClick={clearAllTransactionsCallback}>
<Trans id="wallet.clearAllTransactions">(clear all)</Trans>
</LinkStyledButton>
</AutoRow> </AutoRow>
{renderTransactions(pendingTransactions)} {renderTransactions(pendingTransactions)}
{renderTransactions(confirmedTransactions)} {renderTransactions(confirmedTransactions)}
</LowerSection> </LowerSection>
) : ( ) : (
<LowerSection> <LowerSection>
<TYPE.body color={theme.text1}>Your transactions will appear here...</TYPE.body> <TYPE.body color={theme.text1}>
<Trans id="wallet.yourTransactionsWillAppearHere">Your transactions will appear here...</Trans>
</TYPE.body>
</LowerSection> </LowerSection>
)} )}
</> </>
......
import React, { ReactNode, useMemo } from 'react' import React, { ReactNode, useMemo } from 'react'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { Trans } from '@lingui/macro'
// SDN OFAC addresses // SDN OFAC addresses
const BLOCKED_ADDRESSES: string[] = [ const BLOCKED_ADDRESSES: string[] = [
...@@ -14,7 +15,11 @@ export default function Blocklist({ children }: { children: ReactNode }) { ...@@ -14,7 +15,11 @@ export default function Blocklist({ children }: { children: ReactNode }) {
const { account } = useActiveWeb3React() const { account } = useActiveWeb3React()
const blocked: boolean = useMemo(() => Boolean(account && BLOCKED_ADDRESSES.indexOf(account) !== -1), [account]) const blocked: boolean = useMemo(() => Boolean(account && BLOCKED_ADDRESSES.indexOf(account) !== -1), [account])
if (blocked) { if (blocked) {
return <div>Blocked address</div> return (
<div>
<Trans id="blocklist.labels.blockedAddress">Blocked address</Trans>
</div>
)
} }
return <>{children}</> return <>{children}</>
} }
...@@ -4,6 +4,7 @@ import useTheme from '../../hooks/useTheme' ...@@ -4,6 +4,7 @@ import useTheme from '../../hooks/useTheme'
import { TYPE } from '../../theme' import { TYPE } from '../../theme'
import { warningSeverity } from '../../utils/prices' import { warningSeverity } from '../../utils/prices'
import HoverInlineText from 'components/HoverInlineText' import HoverInlineText from 'components/HoverInlineText'
import { Trans } from '@lingui/macro'
export function FiatValue({ export function FiatValue({
fiatValue, fiatValue,
...@@ -24,10 +25,18 @@ export function FiatValue({ ...@@ -24,10 +25,18 @@ export function FiatValue({
return ( return (
<TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}> <TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>
{fiatValue ? '~$' : ''} {fiatValue ? (
<HoverInlineText text={fiatValue ? fiatValue?.toSignificant(6, { groupSeparator: ',' }) : ''} />{' '} <Trans id="currencies.labels.fiatValue">
~$ <HoverInlineText text={fiatValue?.toSignificant(6, { groupSeparator: ',' })} />
</Trans>
) : (
''
)}
{priceImpact ? ( {priceImpact ? (
<span style={{ color: priceImpactColor }}> ({priceImpact.multiply(-1).toSignificant(3)}%)</span> <span style={{ color: priceImpactColor }}>
{' '}
(<Trans id="numbers.valueWithPercent">{priceImpact.multiply(-1).toSignificant(3)}%</Trans>)
</span>
) : null} ) : null}
</TYPE.body> </TYPE.body>
) )
......
...@@ -4,6 +4,7 @@ import styled from 'styled-components/macro' ...@@ -4,6 +4,7 @@ import styled from 'styled-components/macro'
import { AlertTriangle, X } from 'react-feather' import { AlertTriangle, X } from 'react-feather'
import { useURLWarningToggle, useURLWarningVisible } from '../../state/user/hooks' import { useURLWarningToggle, useURLWarningVisible } from '../../state/user/hooks'
import { isMobile } from 'react-device-detect' import { isMobile } from 'react-device-detect'
import { Trans } from '@lingui/macro'
const PhishAlert = styled.div<{ isActive: any }>` const PhishAlert = styled.div<{ isActive: any }>`
width: 100%; width: 100%;
...@@ -29,17 +30,23 @@ export default function URLWarning() { ...@@ -29,17 +30,23 @@ export default function URLWarning() {
return isMobile ? ( return isMobile ? (
<PhishAlert isActive={showURLWarning}> <PhishAlert isActive={showURLWarning}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<AlertTriangle style={{ marginRight: 6 }} size={12} /> Make sure the URL is <AlertTriangle style={{ marginRight: 6 }} size={12} />
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code> <Trans id="phish.urlWarning">
Make sure the URL is
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code>
</Trans>
</div> </div>
<StyledClose size={12} onClick={toggleURLWarning} /> <StyledClose size={12} onClick={toggleURLWarning} />
</PhishAlert> </PhishAlert>
) : window.location.hostname === 'app.uniswap.org' ? ( ) : window.location.hostname === 'app.uniswap.org' ? (
<PhishAlert isActive={showURLWarning}> <PhishAlert isActive={showURLWarning}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<AlertTriangle style={{ marginRight: 6 }} size={12} /> Always make sure the URL is <AlertTriangle style={{ marginRight: 6 }} size={12} />
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code> - bookmark it <Trans id="phish.urlWarningLocationOk">
to be safe. Always make sure the URL is
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code> - bookmark it
to be safe.
</Trans>
</div> </div>
<StyledClose size={12} onClick={toggleURLWarning} /> <StyledClose size={12} onClick={toggleURLWarning} />
</PhishAlert> </PhishAlert>
......
...@@ -16,6 +16,7 @@ import useUSDCPrice from '../../hooks/useUSDCPrice' ...@@ -16,6 +16,7 @@ import useUSDCPrice from '../../hooks/useUSDCPrice'
import { AutoColumn } from '../Column' import { AutoColumn } from '../Column'
import { RowBetween } from '../Row' import { RowBetween } from '../Row'
import { Break, CardBGImage, CardNoise, CardSection, DataCard } from '../earn/styled' import { Break, CardBGImage, CardNoise, CardSection, DataCard } from '../earn/styled'
import { Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -65,7 +66,9 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU ...@@ -65,7 +66,9 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
<CardNoise /> <CardNoise />
<CardSection gap="md"> <CardSection gap="md">
<RowBetween> <RowBetween>
<TYPE.white color="white">Your UNI Breakdown</TYPE.white> <TYPE.white color="white">
<Trans id="uni.yourUNIBreakdown">Your UNI Breakdown</Trans>
</TYPE.white>
<StyledClose stroke="white" onClick={() => setShowUniBalanceModal(false)} /> <StyledClose stroke="white" onClick={() => setShowUniBalanceModal(false)} />
</RowBetween> </RowBetween>
</CardSection> </CardSection>
...@@ -81,16 +84,20 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU ...@@ -81,16 +84,20 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
</AutoColumn> </AutoColumn>
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white color="white">Balance:</TYPE.white> <TYPE.white color="white">
<Trans id="claim.labels.balance">Balance:</Trans>
</TYPE.white>
<TYPE.white color="white">{uniBalance?.toFixed(2, { groupSeparator: ',' })}</TYPE.white> <TYPE.white color="white">{uniBalance?.toFixed(2, { groupSeparator: ',' })}</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white color="white">Unclaimed:</TYPE.white> <TYPE.white color="white">
<Trans id="claim.unclaimed">Unclaimed:</Trans>
</TYPE.white>
<TYPE.white color="white"> <TYPE.white color="white">
{uniToClaim?.toFixed(4, { groupSeparator: ',' })}{' '} {uniToClaim?.toFixed(4, { groupSeparator: ',' })}{' '}
{uniToClaim && uniToClaim.greaterThan('0') && ( {uniToClaim && uniToClaim.greaterThan('0') && (
<StyledInternalLink onClick={() => setShowUniBalanceModal(false)} to="/uni"> <StyledInternalLink onClick={() => setShowUniBalanceModal(false)} to="/uni">
(claim) <Trans id="claim.labels.claim">(claim)</Trans>
</StyledInternalLink> </StyledInternalLink>
)} )}
</TYPE.white> </TYPE.white>
...@@ -103,19 +110,27 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU ...@@ -103,19 +110,27 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
<CardSection gap="sm"> <CardSection gap="sm">
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white color="white">UNI price:</TYPE.white> <TYPE.white color="white">
<Trans id="uni.UNIPrice">UNI price:</Trans>
</TYPE.white>
<TYPE.white color="white">${uniPrice?.toFixed(2) ?? '-'}</TYPE.white> <TYPE.white color="white">${uniPrice?.toFixed(2) ?? '-'}</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white color="white">UNI in circulation:</TYPE.white> <TYPE.white color="white">
<Trans id="uni.inCirculation">UNI in circulation:</Trans>
</TYPE.white>
<TYPE.white color="white">{circulation?.toFixed(0, { groupSeparator: ',' })}</TYPE.white> <TYPE.white color="white">{circulation?.toFixed(0, { groupSeparator: ',' })}</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white color="white">Total Supply</TYPE.white> <TYPE.white color="white">
<Trans id="uni.totalSupply">Total Supply</Trans>
</TYPE.white>
<TYPE.white color="white">{totalSupply?.toFixed(0, { groupSeparator: ',' })}</TYPE.white> <TYPE.white color="white">{totalSupply?.toFixed(0, { groupSeparator: ',' })}</TYPE.white>
</RowBetween> </RowBetween>
{uni && uni.chainId === 1 ? ( {uni && uni.chainId === 1 ? (
<ExternalLink href={`https://info.uniswap.org/token/${uni.address}`}>View UNI Analytics</ExternalLink> <ExternalLink href={`https://info.uniswap.org/token/${uni.address}`}>
<Trans id="uni.viewAnalytics">View UNI Analytics</Trans>
</ExternalLink>
) : null} ) : null}
</AutoColumn> </AutoColumn>
</CardSection> </CardSection>
......
...@@ -8,6 +8,7 @@ import { AutoColumn } from 'components/Column' ...@@ -8,6 +8,7 @@ import { AutoColumn } from 'components/Column'
import { ButtonPrimary } from 'components/Button' import { ButtonPrimary } from 'components/Button'
import { FeeAmount } from '@uniswap/v3-sdk' import { FeeAmount } from '@uniswap/v3-sdk'
import { formattedFeeAmount } from 'utils' import { formattedFeeAmount } from 'utils'
import { Trans } from '@lingui/macro'
const pulse = (color: string) => keyframes` const pulse = (color: string) => keyframes`
0% { 0% {
...@@ -139,16 +140,22 @@ const StepCounter = ({ ...@@ -139,16 +140,22 @@ const StepCounter = ({
}} }}
/> />
<InputTitle fontSize={12} textAlign="center"> <InputTitle fontSize={12} textAlign="center">
{tokenB + ' per ' + tokenA} <Trans id="currencies.denominated">
{tokenB} per {tokenA}
</Trans>
</InputTitle> </InputTitle>
</AutoColumn> </AutoColumn>
{!locked ? ( {!locked ? (
<RowBetween> <RowBetween>
<SmallButton onClick={handleDecrement}> <SmallButton onClick={handleDecrement}>
<TYPE.white fontSize="12px">-{feeAmountFormatted}%</TYPE.white> <TYPE.white fontSize="12px">
<Trans id="inputs.feeAmount.minus">-{feeAmountFormatted}%</Trans>
</TYPE.white>
</SmallButton> </SmallButton>
<SmallButton onClick={handleIncrement}> <SmallButton onClick={handleIncrement}>
<TYPE.white fontSize="12px">+{feeAmountFormatted}%</TYPE.white> <TYPE.white fontSize="12px">
<Trans id="inputs.feeAmount.plus">+{feeAmountFormatted}%</Trans>
</TYPE.white>
</SmallButton> </SmallButton>
</RowBetween> </RowBetween>
) : null} ) : null}
......
...@@ -7,6 +7,7 @@ import { useActiveWeb3React } from '../../hooks/web3' ...@@ -7,6 +7,7 @@ import { useActiveWeb3React } from '../../hooks/web3'
import { useOnClickOutside } from '../../hooks/useOnClickOutside' import { useOnClickOutside } from '../../hooks/useOnClickOutside'
import { ApplicationModal } from '../../state/application/actions' import { ApplicationModal } from '../../state/application/actions'
import { useModalOpen, useToggleModal } from '../../state/application/hooks' import { useModalOpen, useToggleModal } from '../../state/application/hooks'
import { Trans } from '@lingui/macro'
import { ExternalLink } from '../../theme' import { ExternalLink } from '../../theme'
import { ButtonPrimary } from '../Button' import { ButtonPrimary } from '../Button'
...@@ -142,27 +143,37 @@ export default function Menu() { ...@@ -142,27 +143,37 @@ export default function Menu() {
<MenuFlyout> <MenuFlyout>
<MenuItem href="https://uniswap.org/"> <MenuItem href="https://uniswap.org/">
<Info size={14} /> <Info size={14} />
<div>About</div> <div>
<Trans id="menu.about">About</Trans>
</div>
</MenuItem> </MenuItem>
<MenuItem href="https://docs.uniswap.org/"> <MenuItem href="https://docs.uniswap.org/">
<BookOpen size={14} /> <BookOpen size={14} />
<div>Docs</div> <div>
<Trans id="menu.docs">Docs</Trans>
</div>
</MenuItem> </MenuItem>
<MenuItem href={CODE_LINK}> <MenuItem href={CODE_LINK}>
<Code size={14} /> <Code size={14} />
<div>Code</div> <div>
<Trans id="menu.code">Code</Trans>
</div>
</MenuItem> </MenuItem>
<MenuItem href="https://discord.gg/FCfyBSbCU5"> <MenuItem href="https://discord.gg/FCfyBSbCU5">
<MessageCircle size={14} /> <MessageCircle size={14} />
<div>Discord</div> <div>
<Trans id="menu.discord">Discord</Trans>
</div>
</MenuItem> </MenuItem>
<MenuItem href="https://info.uniswap.org/"> <MenuItem href="https://info.uniswap.org/">
<PieChart size={14} /> <PieChart size={14} />
<div>Analytics</div> <div>
<Trans id="menu.analytics">Analytics</Trans>
</div>
</MenuItem> </MenuItem>
{account && ( {account && (
<UNIbutton onClick={openClaimModal} padding="8px 16px" width="100%" borderRadius="12px" mt="0.5rem"> <UNIbutton onClick={openClaimModal} padding="8px 16px" width="100%" borderRadius="12px" mt="0.5rem">
Claim UNI <Trans id="claim.buttons.claimUNI">Claim UNI</Trans>
</UNIbutton> </UNIbutton>
)} )}
</MenuFlyout> </MenuFlyout>
......
...@@ -7,6 +7,7 @@ import styled, { ThemeContext } from 'styled-components' ...@@ -7,6 +7,7 @@ import styled, { ThemeContext } from 'styled-components'
import { RowBetween } from '../Row' import { RowBetween } from '../Row'
import { TYPE, CloseIcon, CustomLightSpinner } from '../../theme' import { TYPE, CloseIcon, CustomLightSpinner } from '../../theme'
import { ArrowUpCircle } from 'react-feather' import { ArrowUpCircle } from 'react-feather'
import { Trans } from '@lingui/macro'
import Circle from '../../assets/images/blue-loader.svg' import Circle from '../../assets/images/blue-loader.svg'
import { ExternalLink } from '../../theme/components' import { ExternalLink } from '../../theme/components'
...@@ -32,7 +33,9 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss: ...@@ -32,7 +33,9 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss:
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="100px" justify={'center'}> <AutoColumn gap="100px" justify={'center'}>
{children} {children}
<TYPE.subHeader>Confirm this transaction in your wallet</TYPE.subHeader> <TYPE.subHeader>
<Trans id="wallet.confirmTransaction">Confirm this transaction in your wallet</Trans>
</TYPE.subHeader>
</AutoColumn> </AutoColumn>
</ConfirmOrLoadingWrapper> </ConfirmOrLoadingWrapper>
) )
...@@ -66,7 +69,9 @@ export function SubmittedView({ ...@@ -66,7 +69,9 @@ export function SubmittedView({
href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}
style={{ marginLeft: '4px' }} style={{ marginLeft: '4px' }}
> >
<TYPE.subHeader>View transaction on Etherscan</TYPE.subHeader> <TYPE.subHeader>
<Trans id="transaction.viewOnEherscan">View transaction on Etherscan</Trans>
</TYPE.subHeader>
</ExternalLink> </ExternalLink>
)} )}
</AutoColumn> </AutoColumn>
......
...@@ -3,6 +3,7 @@ import { Token } from '@uniswap/sdk-core' ...@@ -3,6 +3,7 @@ import { Token } from '@uniswap/sdk-core'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Text } from 'rebass' import { Text } from 'rebass'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { Trans } from '@lingui/macro'
import { unwrappedToken } from '../../utils/unwrappedToken' import { unwrappedToken } from '../../utils/unwrappedToken'
import { ButtonEmpty } from '../Button' import { ButtonEmpty } from '../Button'
...@@ -48,7 +49,13 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord ...@@ -48,7 +49,13 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord
<AutoRow gap="8px"> <AutoRow gap="8px">
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} /> <DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`} {!currency0 || !currency1 ? (
<Dots>
<Trans id="common.loading">Loading</Trans>
</Dots>
) : (
`${currency0.symbol}/${currency1.symbol}`
)}
</Text> </Text>
<Badge variant={BadgeVariant.WARNING}>Sushi</Badge> <Badge variant={BadgeVariant.WARNING}>Sushi</Badge>
...@@ -61,7 +68,7 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord ...@@ -61,7 +68,7 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord
as={Link} as={Link}
to={`/migrate/v2/${liquidityToken.address}`} to={`/migrate/v2/${liquidityToken.address}`}
> >
Migrate <Trans id="pools.buttons.migrate">Migrate</Trans>
</ButtonEmpty> </ButtonEmpty>
</RowFixed> </RowFixed>
</FixedHeightRow> </FixedHeightRow>
......
...@@ -7,6 +7,7 @@ import { Link } from 'react-router-dom' ...@@ -7,6 +7,7 @@ import { Link } from 'react-router-dom'
import { Text } from 'rebass' import { Text } from 'rebass'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { useTotalSupply } from '../../hooks/useTotalSupply' import { useTotalSupply } from '../../hooks/useTotalSupply'
import { Trans } from '@lingui/macro'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { useTokenBalance } from '../../state/wallet/hooks' import { useTokenBalance } from '../../state/wallet/hooks'
...@@ -85,7 +86,13 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -85,7 +86,13 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
<AutoRow gap="8px"> <AutoRow gap="8px">
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} /> <DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`} {!currency0 || !currency1 ? (
<Dots>
<Trans id="common.loading">Loading</Trans>
</Dots>
) : (
`${currency0.symbol}/${currency1.symbol}`
)}
</Text> </Text>
</AutoRow> </AutoRow>
<RowFixed gap="8px"> <RowFixed gap="8px">
...@@ -97,12 +104,12 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -97,12 +104,12 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
> >
{showMore ? ( {showMore ? (
<> <>
Manage <Trans id="pools.buttons.manage">Manage</Trans>
<ChevronUp size="20" style={{ marginLeft: '10px' }} /> <ChevronUp size="20" style={{ marginLeft: '10px' }} />
</> </>
) : ( ) : (
<> <>
Manage <Trans id="pools.buttons.manage">Manage</Trans>
<ChevronDown size="20" style={{ marginLeft: '10px' }} /> <ChevronDown size="20" style={{ marginLeft: '10px' }} />
</> </>
)} )}
...@@ -114,7 +121,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -114,7 +121,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
<AutoColumn gap="8px"> <AutoColumn gap="8px">
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Your total pool tokens: <Trans id="pool.yourTotalPoolTokens">Your total pool tokens:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{userPoolBalance ? userPoolBalance.toSignificant(4) : '-'} {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}
...@@ -123,7 +130,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -123,7 +130,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
{stakedBalance && ( {stakedBalance && (
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pool tokens in rewards pool: <Trans id="pool.poolTokensInRewardsPool">Pool tokens in rewards pool:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{stakedBalance.toSignificant(4)} {stakedBalance.toSignificant(4)}
...@@ -133,7 +140,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -133,7 +140,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
<FixedHeightRow> <FixedHeightRow>
<RowFixed> <RowFixed>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pooled {currency0.symbol}: <Trans id="pool.pooledCurrency">Pooled {currency0.symbol}:</Trans>
</Text> </Text>
</RowFixed> </RowFixed>
{token0Deposited ? ( {token0Deposited ? (
...@@ -151,7 +158,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -151,7 +158,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
<FixedHeightRow> <FixedHeightRow>
<RowFixed> <RowFixed>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pooled {currency1.symbol}: <Trans id="pool.pooledCurrency"></Trans>Pooled {currency1.symbol}:
</Text> </Text>
</RowFixed> </RowFixed>
{token1Deposited ? ( {token1Deposited ? (
...@@ -168,7 +175,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -168,7 +175,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Your pool share: <Trans id="pool.yourPoolShare">Your pool share:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{poolTokenPercentage {poolTokenPercentage
...@@ -186,7 +193,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -186,7 +193,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
to={`/migrate/v2/${pair.liquidityToken.address}`} to={`/migrate/v2/${pair.liquidityToken.address}`}
width="64%" width="64%"
> >
Migrate <Trans id="pools.buttons.migrate">Migrate</Trans>
</ButtonPrimary> </ButtonPrimary>
<ButtonSecondary <ButtonSecondary
padding="8px" padding="8px"
...@@ -195,7 +202,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position ...@@ -195,7 +202,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
width="32%" width="32%"
to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`} to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
> >
Remove <Trans id="butons.remove">Remove</Trans>
</ButtonSecondary> </ButtonSecondary>
</RowBetween> </RowBetween>
)} )}
......
...@@ -8,6 +8,7 @@ import { Link } from 'react-router-dom' ...@@ -8,6 +8,7 @@ import { Link } from 'react-router-dom'
import { Text } from 'rebass' import { Text } from 'rebass'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { useTotalSupply } from '../../hooks/useTotalSupply' import { useTotalSupply } from '../../hooks/useTotalSupply'
import { Trans } from '@lingui/macro'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { useTokenBalance } from '../../state/wallet/hooks' import { useTokenBalance } from '../../state/wallet/hooks'
...@@ -91,7 +92,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos ...@@ -91,7 +92,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
<FixedHeightRow> <FixedHeightRow>
<RowFixed> <RowFixed>
<Text fontWeight={500} fontSize={16}> <Text fontWeight={500} fontSize={16}>
Your position <Trans id="pool.yourPosition">Your position</Trans>
</Text> </Text>
</RowFixed> </RowFixed>
</FixedHeightRow> </FixedHeightRow>
...@@ -111,7 +112,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos ...@@ -111,7 +112,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
<AutoColumn gap="4px"> <AutoColumn gap="4px">
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Your pool share: <Trans id="pool.yourPoolShare">Your pool share:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{poolTokenPercentage ? poolTokenPercentage.toFixed(6) + '%' : '-'} {poolTokenPercentage ? poolTokenPercentage.toFixed(6) + '%' : '-'}
...@@ -154,8 +155,10 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos ...@@ -154,8 +155,10 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
<span role="img" aria-label="wizard-icon"> <span role="img" aria-label="wizard-icon">
⭐️ ⭐️
</span>{' '} </span>{' '}
By adding liquidity you&apos;ll earn 0.3% of all trades on this pair proportional to your share of the pool. <Trans id="pool.noLiquidityHint">
Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity. By adding liquidity you&apos;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.
</Trans>{' '}
</TYPE.subHeader> </TYPE.subHeader>
</LightCard> </LightCard>
)} )}
...@@ -206,19 +209,25 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -206,19 +209,25 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<AutoRow gap="8px" style={{ marginLeft: '8px' }}> <AutoRow gap="8px" style={{ marginLeft: '8px' }}>
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} /> <DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`} {!currency0 || !currency1 ? (
<Dots>
<Trans id="common.loading">Loading</Trans>
</Dots>
) : (
`${currency0.symbol}/${currency1.symbol}`
)}
</Text> </Text>
</AutoRow> </AutoRow>
<RowFixed gap="8px" style={{ marginRight: '4px' }}> <RowFixed gap="8px" style={{ marginRight: '4px' }}>
<ButtonEmpty padding="6px 8px" borderRadius="12px" width="100%" onClick={() => setShowMore(!showMore)}> <ButtonEmpty padding="6px 8px" borderRadius="12px" width="100%" onClick={() => setShowMore(!showMore)}>
{showMore ? ( {showMore ? (
<> <>
Manage <Trans id="pools.buttons.manage">Manage</Trans>
<ChevronUp size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} /> <ChevronUp size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
</> </>
) : ( ) : (
<> <>
Manage <Trans id="pools.buttons.manage">Manage</Trans>
<ChevronDown size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} /> <ChevronDown size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
</> </>
)} )}
...@@ -230,7 +239,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -230,7 +239,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<AutoColumn gap="8px"> <AutoColumn gap="8px">
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Your total pool tokens: <Trans id="pool.yourTotalPoolTokens">Your total pool tokens:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{userPoolBalance ? userPoolBalance.toSignificant(4) : '-'} {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}
...@@ -239,7 +248,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -239,7 +248,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
{stakedBalance && ( {stakedBalance && (
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pool tokens in rewards pool: <Trans id="pool.poolTokensInRewardsPool">Pool tokens in rewards pool:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{stakedBalance.toSignificant(4)} {stakedBalance.toSignificant(4)}
...@@ -249,7 +258,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -249,7 +258,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<FixedHeightRow> <FixedHeightRow>
<RowFixed> <RowFixed>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pooled {currency0.symbol}: <Trans id="pool.pooledCurrency">Pooled {currency0.symbol}:</Trans>
</Text> </Text>
</RowFixed> </RowFixed>
{token0Deposited ? ( {token0Deposited ? (
...@@ -267,7 +276,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -267,7 +276,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<FixedHeightRow> <FixedHeightRow>
<RowFixed> <RowFixed>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Pooled {currency1.symbol}: <Trans id="pool.pooledCurrency">Pooled {currency1.symbol}:</Trans>
</Text> </Text>
</RowFixed> </RowFixed>
{token1Deposited ? ( {token1Deposited ? (
...@@ -284,12 +293,16 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -284,12 +293,16 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
<FixedHeightRow> <FixedHeightRow>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
Your pool share: <Trans id="pool.yourPoolShare">Your pool share:</Trans>
</Text> </Text>
<Text fontSize={16} fontWeight={500}> <Text fontSize={16} fontWeight={500}>
{poolTokenPercentage {poolTokenPercentage ? (
? (poolTokenPercentage.toFixed(2) === '0.00' ? '<0.01' : poolTokenPercentage.toFixed(2)) + '%' <Trans id="numbers.valueWithPercent">
: '-'} {poolTokenPercentage.toFixed(2) === '0.00' ? '<0.01' : poolTokenPercentage.toFixed(2)} %
</Trans>
) : (
'-'
)}
</Text> </Text>
</FixedHeightRow> </FixedHeightRow>
...@@ -298,7 +311,9 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -298,7 +311,9 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
style={{ width: '100%', textAlign: 'center' }} style={{ width: '100%', textAlign: 'center' }}
href={`https://v2.info.uniswap.org/account/${account}`} href={`https://v2.info.uniswap.org/account/${account}`}
> >
View accrued fees and analytics<span style={{ fontSize: '11px' }}></span> <Trans id="links.viewAccruedFees">
View accrued fees and analytics<span style={{ fontSize: '11px' }}></span>
</Trans>
</ExternalLink> </ExternalLink>
</ButtonSecondary> </ButtonSecondary>
{userDefaultPoolBalance && JSBI.greaterThan(userDefaultPoolBalance.quotient, BIG_INT_ZERO) && ( {userDefaultPoolBalance && JSBI.greaterThan(userDefaultPoolBalance.quotient, BIG_INT_ZERO) && (
...@@ -310,7 +325,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -310,7 +325,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
to={`/migrate/v2/${pair.liquidityToken.address}`} to={`/migrate/v2/${pair.liquidityToken.address}`}
width="32%" width="32%"
> >
Migrate <Trans id="pools.buttons.migrate">Migrate</Trans>
</ButtonPrimary> </ButtonPrimary>
<ButtonPrimary <ButtonPrimary
padding="8px" padding="8px"
...@@ -319,7 +334,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -319,7 +334,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
to={`/add/v2/${currencyId(currency0)}/${currencyId(currency1)}`} to={`/add/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
width="32%" width="32%"
> >
Add <Trans id="pools.buttons.add">Add</Trans>
</ButtonPrimary> </ButtonPrimary>
<ButtonPrimary <ButtonPrimary
padding="8px" padding="8px"
...@@ -328,7 +343,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -328,7 +343,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
width="32%" width="32%"
to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`} to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
> >
Remove <Trans id="butons.remove">Remove</Trans>
</ButtonPrimary> </ButtonPrimary>
</RowBetween> </RowBetween>
)} )}
...@@ -340,7 +355,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi ...@@ -340,7 +355,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`} to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`}
width="100%" width="100%"
> >
Manage Liquidity in Rewards Pool <Trans id="pools.buttons.manageLiquidityInRewardsPool">Manage Liquidity in Rewards Pool</Trans>
</ButtonPrimary> </ButtonPrimary>
)} )}
</AutoColumn> </AutoColumn>
......
...@@ -16,6 +16,7 @@ import RangeBadge from 'components/Badge/RangeBadge' ...@@ -16,6 +16,7 @@ import RangeBadge from 'components/Badge/RangeBadge'
import { RowFixed } from 'components/Row' import { RowFixed } from 'components/Row'
import HoverInlineText from 'components/HoverInlineText' import HoverInlineText from 'components/HoverInlineText'
import { DAI, USDC, USDT, WBTC } from '../../constants/tokens' import { DAI, USDC, USDT, WBTC } from '../../constants/tokens'
import { Trans } from '@lingui/macro'
const LinkRow = styled(Link)` const LinkRow = styled(Link)`
align-items: center; align-items: center;
...@@ -223,7 +224,9 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr ...@@ -223,7 +224,9 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
</DataText> </DataText>
&nbsp; &nbsp;
<Badge> <Badge>
<BadgeText>{new Percent(feeAmount, 1_000_000).toSignificant()}%</BadgeText> <BadgeText>
<Trans id="numbers.valueWithPercent">{new Percent(feeAmount, 1_000_000).toSignificant()}%</Trans>
</BadgeText>
</Badge> </Badge>
</PrimaryPositionIdData> </PrimaryPositionIdData>
<RangeBadge removed={removed} inRange={!outOfRange} /> <RangeBadge removed={removed} inRange={!outOfRange} />
...@@ -232,9 +235,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr ...@@ -232,9 +235,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
{priceLower && priceUpper ? ( {priceLower && priceUpper ? (
<RangeLineItem> <RangeLineItem>
<RangeText> <RangeText>
<ExtentsText>Min: </ExtentsText> <ExtentsText>
{formatPrice(priceLower, 5)} <HoverInlineText text={currencyQuote?.symbol} /> {' per '}{' '} <Trans id="pools.labels.min">Min: </Trans>
<HoverInlineText text={currencyBase?.symbol ?? ''} /> </ExtentsText>
<Trans id="currencies.denominatedWithValue">
{formatPrice(priceLower, 5)} <HoverInlineText text={currencyQuote?.symbol} /> per{' '}
<HoverInlineText text={currencyBase?.symbol ?? ''} />
</Trans>
</RangeText>{' '} </RangeText>{' '}
<HideSmall> <HideSmall>
<DoubleArrow></DoubleArrow>{' '} <DoubleArrow></DoubleArrow>{' '}
...@@ -243,9 +250,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr ...@@ -243,9 +250,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
<DoubleArrow></DoubleArrow>{' '} <DoubleArrow></DoubleArrow>{' '}
</SmallOnly> </SmallOnly>
<RangeText> <RangeText>
<ExtentsText>Max:</ExtentsText> <ExtentsText>
{formatPrice(priceUpper, 5)} <HoverInlineText text={currencyQuote?.symbol} /> {' per '}{' '} <Trans id="pools.labels.max">Max:</Trans>
<HoverInlineText maxCharacters={10} text={currencyBase?.symbol} /> </ExtentsText>
<Trans id="currencies.denominatedWithValue">
{formatPrice(priceUpper, 5)} <HoverInlineText text={currencyQuote?.symbol} /> per{' '}
<HoverInlineText maxCharacters={10} text={currencyBase?.symbol} />
</Trans>
</RangeText> </RangeText>
</RangeLineItem> </RangeLineItem>
) : ( ) : (
......
...@@ -11,6 +11,7 @@ import styled from 'styled-components/macro' ...@@ -11,6 +11,7 @@ import styled from 'styled-components/macro'
import { useIsUserAddedToken, useIsTokenActive } from 'hooks/Tokens' import { useIsUserAddedToken, useIsTokenActive } from 'hooks/Tokens'
import { CheckCircle } from 'react-feather' import { CheckCircle } from 'react-feather'
import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo'
import { Trans } from '@lingui/macro'
const TokenSection = styled.div<{ dim?: boolean }>` const TokenSection = styled.div<{ dim?: boolean }>`
padding: 4px 20px; padding: 4px 20px;
...@@ -73,7 +74,7 @@ export default function ImportRow({ ...@@ -73,7 +74,7 @@ export default function ImportRow({
{list && list.logoURI && ( {list && list.logoURI && (
<RowFixed> <RowFixed>
<TYPE.small mr="4px" color={theme.text3}> <TYPE.small mr="4px" color={theme.text3}>
via {list.name} <Trans id="tokenLists.via">via {list.name} </Trans>
</TYPE.small> </TYPE.small>
<ListLogo logoURI={list.logoURI} size="12px" /> <ListLogo logoURI={list.logoURI} size="12px" />
</RowFixed> </RowFixed>
...@@ -90,12 +91,14 @@ export default function ImportRow({ ...@@ -90,12 +91,14 @@ export default function ImportRow({
showImportView() showImportView()
}} }}
> >
Import <Trans id="tokensLists.buttons.import">Import</Trans>
</ButtonPrimary> </ButtonPrimary>
) : ( ) : (
<RowFixed style={{ minWidth: 'fit-content' }}> <RowFixed style={{ minWidth: 'fit-content' }}>
<CheckIcon /> <CheckIcon />
<TYPE.main color={theme.green1}>Active</TYPE.main> <TYPE.main color={theme.green1}>
<Trans id="tokenLists.labels.active">Active</Trans>
</TYPE.main>
</RowFixed> </RowFixed>
)} )}
</TokenSection> </TokenSection>
......
...@@ -7,6 +7,7 @@ import styled from 'styled-components/macro' ...@@ -7,6 +7,7 @@ import styled from 'styled-components/macro'
import { useFetchListCallback } from '../../hooks/useFetchListCallback' import { useFetchListCallback } from '../../hooks/useFetchListCallback'
import { useOnClickOutside } from '../../hooks/useOnClickOutside' import { useOnClickOutside } from '../../hooks/useOnClickOutside'
import { TokenList } from '@uniswap/token-lists' import { TokenList } from '@uniswap/token-lists'
import { t, Trans } from '@lingui/macro'
import useToggle from '../../hooks/useToggle' import useToggle from '../../hooks/useToggle'
import { AppDispatch, AppState } from '../../state' import { AppDispatch, AppState } from '../../state'
...@@ -173,7 +174,7 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) { ...@@ -173,7 +174,7 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) {
</Row> </Row>
<RowFixed mt="4px"> <RowFixed mt="4px">
<StyledListUrlText active={isActive} mr="6px"> <StyledListUrlText active={isActive} mr="6px">
{list.tokens.length} tokens <Trans id="tokenLists.numberOfTokens">{list.tokens.length} tokens</Trans>
</StyledListUrlText> </StyledListUrlText>
<StyledMenu ref={node as any}> <StyledMenu ref={node as any}>
<ButtonEmpty onClick={toggle} ref={setReferenceElement} padding="0"> <ButtonEmpty onClick={toggle} ref={setReferenceElement} padding="0">
...@@ -183,12 +184,16 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) { ...@@ -183,12 +184,16 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) {
<PopoverContainer show={true} ref={setPopperElement as any} style={styles.popper} {...attributes.popper}> <PopoverContainer show={true} ref={setPopperElement as any} style={styles.popper} {...attributes.popper}>
<div>{list && listVersionLabel(list.version)}</div> <div>{list && listVersionLabel(list.version)}</div>
<SeparatorDark /> <SeparatorDark />
<ExternalLink href={`https://tokenlists.org/token-list?url=${listUrl}`}>View list</ExternalLink> <ExternalLink href={`https://tokenlists.org/token-list?url=${listUrl}`}>
<Trans id="tokenLists.links.viewList">View list</Trans>
</ExternalLink>
<UnpaddedLinkStyledButton onClick={handleRemoveList} disabled={Object.keys(listsByUrl).length === 1}> <UnpaddedLinkStyledButton onClick={handleRemoveList} disabled={Object.keys(listsByUrl).length === 1}>
Remove list <Trans id="tokenLists.buttons.removeList">Remove list</Trans>
</UnpaddedLinkStyledButton> </UnpaddedLinkStyledButton>
{pending && ( {pending && (
<UnpaddedLinkStyledButton onClick={handleAcceptListUpdate}>Update list</UnpaddedLinkStyledButton> <UnpaddedLinkStyledButton onClick={handleAcceptListUpdate}>
<Trans id="tokenLists.buttons.updateLists">Update list</Trans>
</UnpaddedLinkStyledButton>
)} )}
</PopoverContainer> </PopoverContainer>
)} )}
...@@ -287,14 +292,15 @@ export function ManageLists({ ...@@ -287,14 +292,15 @@ export function ManageLists({
async function fetchTempList() { async function fetchTempList() {
fetchList(listUrlInput, false) fetchList(listUrlInput, false)
.then((list) => setTempList(list)) .then((list) => setTempList(list))
.catch(() => setAddError('Error importing list')) .catch(() => setAddError(t({ id: 'tokenLists.errors.importingList', message: 'Error importing list' })))
} }
// if valid url, fetch details for card // if valid url, fetch details for card
if (validUrl) { if (validUrl) {
fetchTempList() fetchTempList()
} else { } else {
setTempList(undefined) setTempList(undefined)
listUrlInput !== '' && setAddError('Enter valid list location') listUrlInput !== '' &&
setAddError(t({ id: 'tokenList.errors.invalidLocation', message: 'Enter valid list location' }))
} }
// reset error // reset error
...@@ -348,7 +354,9 @@ export function ManageLists({ ...@@ -348,7 +354,9 @@ export function ManageLists({
<IconWrapper stroke={theme.text2} size="16px" marginRight={'10px'}> <IconWrapper stroke={theme.text2} size="16px" marginRight={'10px'}>
<CheckCircle /> <CheckCircle />
</IconWrapper> </IconWrapper>
<TYPE.body color={theme.text2}>Loaded</TYPE.body> <TYPE.body color={theme.text2}>
<Trans id="common.loaded">Loaded</Trans>
</TYPE.body>
</RowFixed> </RowFixed>
) : ( ) : (
<ButtonPrimary <ButtonPrimary
...@@ -357,7 +365,7 @@ export function ManageLists({ ...@@ -357,7 +365,7 @@ export function ManageLists({
width="fit-content" width="fit-content"
onClick={handleImport} onClick={handleImport}
> >
Import <Trans id="tokenLists.buttons.import">Import</Trans>
</ButtonPrimary> </ButtonPrimary>
)} )}
</RowBetween> </RowBetween>
......
...@@ -14,6 +14,7 @@ import { useActiveWeb3React } from 'hooks/web3' ...@@ -14,6 +14,7 @@ import { useActiveWeb3React } from 'hooks/web3'
import Card from 'components/Card' import Card from 'components/Card'
import ImportRow from './ImportRow' import ImportRow from './ImportRow'
import useTheme from '../../hooks/useTheme' import useTheme from '../../hooks/useTheme'
import { Trans } from '@lingui/macro'
import { CurrencyModalView } from './CurrencySearchModal' import { CurrencyModalView } from './CurrencySearchModal'
...@@ -109,7 +110,11 @@ export default function ManageTokens({ ...@@ -109,7 +110,11 @@ export default function ManageTokens({
onChange={handleInput} onChange={handleInput}
/> />
</Row> </Row>
{searchQuery !== '' && !isAddressSearch && <TYPE.error error={true}>Enter valid token address</TYPE.error>} {searchQuery !== '' && !isAddressSearch && (
<TYPE.error error={true}>
<Trans id="tokenLists.input.enterValidAddress">Enter valid token address</Trans>
</TYPE.error>
)}
{searchToken && ( {searchToken && (
<Card backgroundColor={theme.bg2} padding="10px 0"> <Card backgroundColor={theme.bg2} padding="10px 0">
<ImportRow <ImportRow
...@@ -125,11 +130,14 @@ export default function ManageTokens({ ...@@ -125,11 +130,14 @@ export default function ManageTokens({
<PaddedColumn gap="lg" style={{ overflow: 'auto', marginBottom: '10px' }}> <PaddedColumn gap="lg" style={{ overflow: 'auto', marginBottom: '10px' }}>
<RowBetween> <RowBetween>
<TYPE.main fontWeight={600}> <TYPE.main fontWeight={600}>
{/* TODO(judo): handle plural */}
{userAddedTokens?.length} Custom {userAddedTokens.length === 1 ? 'Token' : 'Tokens'} {userAddedTokens?.length} Custom {userAddedTokens.length === 1 ? 'Token' : 'Tokens'}
</TYPE.main> </TYPE.main>
{userAddedTokens.length > 0 && ( {userAddedTokens.length > 0 && (
<ButtonText onClick={handleRemoveAll}> <ButtonText onClick={handleRemoveAll}>
<TYPE.blue>Clear all</TYPE.blue> <TYPE.blue>
<Trans id="common.clearAll">Clear all</Trans>
</TYPE.blue>
</ButtonText> </ButtonText>
)} )}
</RowBetween> </RowBetween>
...@@ -137,7 +145,9 @@ export default function ManageTokens({ ...@@ -137,7 +145,9 @@ export default function ManageTokens({
</PaddedColumn> </PaddedColumn>
</Column> </Column>
<Footer> <Footer>
<TYPE.darkGray>Tip: Custom tokens are stored locally in your browser</TYPE.darkGray> <TYPE.darkGray>
<Trans id="tokenLists.manageHint">Tip: Custom tokens are stored locally in your browser</Trans>
</TYPE.darkGray>
</Footer> </Footer>
</Wrapper> </Wrapper>
) )
......
...@@ -14,6 +14,7 @@ import Circle from '../../assets/images/blue-loader.svg' ...@@ -14,6 +14,7 @@ import Circle from '../../assets/images/blue-loader.svg'
import MetaMaskLogo from '../../assets/images/metamask.png' import MetaMaskLogo from '../../assets/images/metamask.png'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import useAddTokenToMetamask from 'hooks/useAddTokenToMetamask' import useAddTokenToMetamask from 'hooks/useAddTokenToMetamask'
import { Trans } from '@lingui/macro'
const Wrapper = styled.div` const Wrapper = styled.div`
width: 100%; width: 100%;
...@@ -61,7 +62,7 @@ export function ConfirmationPendingContent({ ...@@ -61,7 +62,7 @@ export function ConfirmationPendingContent({
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<Text fontWeight={500} fontSize={20} textAlign="center"> <Text fontWeight={500} fontSize={20} textAlign="center">
Waiting For Confirmation <Trans id="transactions.waitingForConfirmation">Waiting For Confirmation</Trans>
</Text> </Text>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<Text fontWeight={600} fontSize={14} color="" textAlign="center"> <Text fontWeight={600} fontSize={14} color="" textAlign="center">
...@@ -69,7 +70,7 @@ export function ConfirmationPendingContent({ ...@@ -69,7 +70,7 @@ export function ConfirmationPendingContent({
</Text> </Text>
</AutoColumn> </AutoColumn>
<Text fontSize={12} color="#565A69" textAlign="center" marginBottom={12}> <Text fontSize={12} color="#565A69" textAlign="center" marginBottom={12}>
Confirm this transaction in your wallet <Trans id="transactions.confirmInWallet">Confirm this transaction in your wallet</Trans>
</Text> </Text>
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
...@@ -110,12 +111,12 @@ export function TransactionSubmittedContent({ ...@@ -110,12 +111,12 @@ export function TransactionSubmittedContent({
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<Text fontWeight={500} fontSize={20} textAlign="center"> <Text fontWeight={500} fontSize={20} textAlign="center">
Transaction Submitted <Trans id="transactions.submitted">Transaction Submitted</Trans>
</Text> </Text>
{chainId && hash && ( {chainId && hash && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}> <ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
<Text fontWeight={500} fontSize={14} color={theme.primary1}> <Text fontWeight={500} fontSize={14} color={theme.primary1}>
View on Etherscan <Trans id="wallet.viewOnEtherscan">View on Etherscan</Trans>
</Text> </Text>
</ExternalLink> </ExternalLink>
)} )}
...@@ -123,11 +124,13 @@ export function TransactionSubmittedContent({ ...@@ -123,11 +124,13 @@ export function TransactionSubmittedContent({
<ButtonLight mt="12px" padding="6px 12px" width="fit-content" onClick={addToken}> <ButtonLight mt="12px" padding="6px 12px" width="fit-content" onClick={addToken}>
{!success ? ( {!success ? (
<RowFixed> <RowFixed>
Add {currencyToAdd.symbol} to Metamask <StyledLogo src={MetaMaskLogo} /> <Trans id="wallet.addTokenToMetamask">
Add {currencyToAdd.symbol} to Metamask <StyledLogo src={MetaMaskLogo} />
</Trans>
</RowFixed> </RowFixed>
) : ( ) : (
<RowFixed> <RowFixed>
Added {currencyToAdd.symbol}{' '} <Trans id="wallet.addedTokenToMetamask">Added {currencyToAdd.symbol} </Trans>
<CheckCircle size={'16px'} stroke={theme.green1} style={{ marginLeft: '6px' }} /> <CheckCircle size={'16px'} stroke={theme.green1} style={{ marginLeft: '6px' }} />
</RowFixed> </RowFixed>
)} )}
...@@ -135,7 +138,7 @@ export function TransactionSubmittedContent({ ...@@ -135,7 +138,7 @@ export function TransactionSubmittedContent({
)} )}
<ButtonPrimary onClick={onDismiss} style={{ margin: '20px 0 0 0' }}> <ButtonPrimary onClick={onDismiss} style={{ margin: '20px 0 0 0' }}>
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{inline ? 'Return' : 'Close'} {inline ? <Trans id="common.return">Return</Trans> : <Trans id="common.close">Close</Trans>}
</Text> </Text>
</ButtonPrimary> </ButtonPrimary>
</AutoColumn> </AutoColumn>
...@@ -195,7 +198,9 @@ export function TransactionErrorContent({ message, onDismiss }: { message: strin ...@@ -195,7 +198,9 @@ export function TransactionErrorContent({ message, onDismiss }: { message: strin
</AutoColumn> </AutoColumn>
</Section> </Section>
<BottomSection gap="12px"> <BottomSection gap="12px">
<ButtonPrimary onClick={onDismiss}>Dismiss</ButtonPrimary> <ButtonPrimary onClick={onDismiss}>
<Trans id="common.dismiss">Dismiss</Trans>
</ButtonPrimary>
</BottomSection> </BottomSection>
</Wrapper> </Wrapper>
) )
......
...@@ -6,6 +6,7 @@ import Option from './Option' ...@@ -6,6 +6,7 @@ import Option from './Option'
import { injected } from '../../connectors' import { injected } from '../../connectors'
import { darken } from 'polished' import { darken } from 'polished'
import Loader from '../Loader' import Loader from '../Loader'
import { Trans } from '@lingui/macro'
const PendingSection = styled.div` const PendingSection = styled.div`
${({ theme }) => theme.flexColumnNoWrap}; ${({ theme }) => theme.flexColumnNoWrap};
...@@ -82,20 +83,22 @@ export default function PendingView({ ...@@ -82,20 +83,22 @@ export default function PendingView({
<LoadingWrapper> <LoadingWrapper>
{error ? ( {error ? (
<ErrorGroup> <ErrorGroup>
<div>Error connecting.</div> <div>
<Trans id="error.connecting">Error connecting</Trans>
</div>
<ErrorButton <ErrorButton
onClick={() => { onClick={() => {
setPendingError(false) setPendingError(false)
connector && tryActivation(connector) connector && tryActivation(connector)
}} }}
> >
Try Again <Trans id="error.tryAgain">Try Again</Trans>
</ErrorButton> </ErrorButton>
</ErrorGroup> </ErrorGroup>
) : ( ) : (
<> <>
<StyledLoader /> <StyledLoader />
Initializing... <Trans id="wallet.initializing">Initializing...</Trans>
</> </>
)} )}
</LoadingWrapper> </LoadingWrapper>
......
...@@ -16,6 +16,7 @@ import { ApplicationModal } from '../../state/application/actions' ...@@ -16,6 +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 Modal from '../Modal' import Modal from '../Modal'
import Option from './Option' import Option from './Option'
...@@ -239,7 +240,7 @@ export default function WalletModal({ ...@@ -239,7 +240,7 @@ export default function WalletModal({
id={`connect-${key}`} id={`connect-${key}`}
key={key} key={key}
color={'#E8831D'} color={'#E8831D'}
header={'Install Metamask'} header={t({ id: 'wallet.installMetamask', message: 'Install Metamask' })}
subheader={null} subheader={null}
link={'https://metamask.io/'} link={'https://metamask.io/'}
icon={MetamaskIcon} icon={MetamaskIcon}
...@@ -290,12 +291,20 @@ export default function WalletModal({ ...@@ -290,12 +291,20 @@ export default function WalletModal({
<CloseIcon onClick={toggleWalletModal}> <CloseIcon onClick={toggleWalletModal}>
<CloseColor /> <CloseColor />
</CloseIcon> </CloseIcon>
<HeaderRow>{error instanceof UnsupportedChainIdError ? 'Wrong Network' : 'Error connecting'}</HeaderRow> <HeaderRow>
{error instanceof UnsupportedChainIdError ? (
<Trans id="error.wrongNetwork">Wrong Network</Trans>
) : (
<Trans id="error.connecting">Error connecting</Trans>
)}
</HeaderRow>
<ContentWrapper> <ContentWrapper>
{error instanceof UnsupportedChainIdError ? ( {error instanceof UnsupportedChainIdError ? (
<h5>Please connect to the appropriate Ethereum network.</h5> <h5>
<Trans id="wallet.connectToNetwork">Please connect to the appropriate Ethereum network.</Trans>
</h5>
) : ( ) : (
'Error connecting. Try refreshing the page.' <Trans id="error.connectingTryRefreshing">Error connecting. Try refreshing the page.</Trans>
)} )}
</ContentWrapper> </ContentWrapper>
</UpperSection> </UpperSection>
...@@ -325,12 +334,14 @@ export default function WalletModal({ ...@@ -325,12 +334,14 @@ export default function WalletModal({
setWalletView(WALLET_VIEWS.ACCOUNT) setWalletView(WALLET_VIEWS.ACCOUNT)
}} }}
> >
Back <Trans id="common.back">Back</Trans>
</HoverText> </HoverText>
</HeaderRow> </HeaderRow>
) : ( ) : (
<HeaderRow> <HeaderRow>
<HoverText>Connect to a wallet</HoverText> <HoverText>
<Trans id="wallet.connectLongForm">Connect to a wallet</Trans>
</HoverText>
</HeaderRow> </HeaderRow>
)} )}
...@@ -338,10 +349,12 @@ export default function WalletModal({ ...@@ -338,10 +349,12 @@ export default function WalletModal({
<LightCard style={{ marginBottom: '16px' }}> <LightCard style={{ marginBottom: '16px' }}>
<AutoRow style={{ flexWrap: 'nowrap' }}> <AutoRow style={{ flexWrap: 'nowrap' }}>
<TYPE.main fontSize={14}> <TYPE.main fontSize={14}>
By connecting a wallet, you agree to Uniswap Labs’{' '} <Trans id="wallet.connectAcknowledgement">
<ExternalLink href="https://uniswap.org/terms-of-service/">Terms of Service</ExternalLink> and By connecting a wallet, you agree to Uniswap Labs’{' '}
acknowledge that you have read and understand the{' '} <ExternalLink href="https://uniswap.org/terms-of-service/">Terms of Service</ExternalLink> and
<ExternalLink href="https://uniswap.org/disclaimer/">Uniswap protocol disclaimer</ExternalLink>. acknowledge that you have read and understand the{' '}
<ExternalLink href="https://uniswap.org/disclaimer/">Uniswap protocol disclaimer</ExternalLink>.
</Trans>
</TYPE.main> </TYPE.main>
</AutoRow> </AutoRow>
</LightCard> </LightCard>
......
...@@ -20,6 +20,7 @@ import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled' ...@@ -20,6 +20,7 @@ import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled'
import { useIsTransactionPending } from '../../state/transactions/hooks' import { useIsTransactionPending } from '../../state/transactions/hooks'
import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { shortenAddress } from '../../utils' import { shortenAddress } from '../../utils'
import { Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -103,23 +104,31 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole ...@@ -103,23 +104,31 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
<CardNoise /> <CardNoise />
<CardSection gap="md"> <CardSection gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={500}>Claim UNI Token</TYPE.white> <TYPE.white fontWeight={500}>
<Trans id="claim.buttons.claimUNIToken">Claim UNI Token</Trans>
</TYPE.white>
<CloseIcon onClick={wrappedOnDismiss} style={{ zIndex: 99 }} stroke="white" /> <CloseIcon onClick={wrappedOnDismiss} style={{ zIndex: 99 }} stroke="white" />
</RowBetween> </RowBetween>
<TYPE.white fontWeight={700} fontSize={36}> <TYPE.white fontWeight={700} fontSize={36}>
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI <Trans id="claim.labels.tokenAmount">
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
</Trans>
</TYPE.white> </TYPE.white>
</CardSection> </CardSection>
<Break /> <Break />
</ModalUpper> </ModalUpper>
<AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center"> <AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center">
<TYPE.subHeader fontWeight={500}> <TYPE.subHeader fontWeight={500}>
Enter an address to trigger a UNI claim. If the address has any claimable UNI it will be sent to them on <Trans id="claim.labels.enterAddress">
submission. Enter an address to trigger a UNI claim. If the address has any claimable UNI it will be sent to them on
submission.
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
<AddressInputPanel value={typed} onChange={handleRecipientType} /> <AddressInputPanel value={typed} onChange={handleRecipientType} />
{parsedAddress && !hasAvailableClaim && ( {parsedAddress && !hasAvailableClaim && (
<TYPE.error error={true}>Address has no available claim</TYPE.error> <TYPE.error error={true}>
<Trans id="claim.noAvailableClaim">Address has no available claim</Trans>
</TYPE.error>
)} )}
<ButtonPrimary <ButtonPrimary
disabled={!isAddress(parsedAddress ?? '') || !hasAvailableClaim} disabled={!isAddress(parsedAddress ?? '') || !hasAvailableClaim}
...@@ -129,7 +138,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole ...@@ -129,7 +138,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
mt="1rem" mt="1rem"
onClick={onClaim} onClick={onClaim}
> >
Claim UNI <Trans id="claim.buttons.claimUNI">Claim UNI</Trans>
</ButtonPrimary> </ButtonPrimary>
</AutoColumn> </AutoColumn>
</ContentWrapper> </ContentWrapper>
...@@ -146,22 +155,28 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole ...@@ -146,22 +155,28 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
{!claimConfirmed ? ( {!claimConfirmed ? (
<CustomLightSpinner src={Circle} alt="loader" size={'90px'} /> <CustomLightSpinner src={Circle} alt="loader" size={'90px'} />
) : ( ) : (
<UniTokenAnimated width="72px" src={tokenLogo} /> <UniTokenAnimated width="72px" src={tokenLogo} alt="UNI logo" />
)} )}
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="100px" justify={'center'}> <AutoColumn gap="100px" justify={'center'}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader fontWeight={600} color="black"> <TYPE.largeHeader fontWeight={600} color="black">
{claimConfirmed ? 'Claimed' : 'Claiming'} {claimConfirmed ? (
<Trans id="claim.label.statusClaimed">Claimed</Trans>
) : (
<Trans id="claim.label.statusClaiming">Claiming</Trans>
)}
</TYPE.largeHeader> </TYPE.largeHeader>
{!claimConfirmed && ( {!claimConfirmed && (
<Text fontSize={36} color={'#ff007a'} fontWeight={800}> <Text fontSize={36} color={'#ff007a'} fontWeight={800}>
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI <Trans id="claim.labels.tokenAmount">
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
</Trans>
</Text> </Text>
)} )}
{parsedAddress && ( {parsedAddress && (
<TYPE.largeHeader fontWeight={600} color="black"> <TYPE.largeHeader fontWeight={600} color="black">
for {shortenAddress(parsedAddress)} <Trans id="claim.labels.address">for {shortenAddress(parsedAddress)}</Trans>
</TYPE.largeHeader> </TYPE.largeHeader>
)} )}
</AutoColumn> </AutoColumn>
...@@ -171,7 +186,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole ...@@ -171,7 +186,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
<span role="img" aria-label="party-hat"> <span role="img" aria-label="party-hat">
🎉{' '} 🎉{' '}
</span> </span>
Welcome to team Unicorn :){' '} <Trans id="claim.labels.welcome">Welcome to team Unicorn :) </Trans>
<span role="img" aria-label="party-hat"> <span role="img" aria-label="party-hat">
🎉 🎉
</span> </span>
...@@ -179,11 +194,13 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole ...@@ -179,11 +194,13 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
</> </>
)} )}
{attempting && !hash && ( {attempting && !hash && (
<TYPE.subHeader color="black">Confirm this transaction in your wallet</TYPE.subHeader> <TYPE.subHeader color="black">
<Trans id="wallet.confirmTransaction">Confirm this transaction in your wallet</Trans>
</TYPE.subHeader>
)} )}
{attempting && hash && !claimConfirmed && chainId && hash && ( {attempting && hash && !claimConfirmed && chainId && hash && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ zIndex: 99 }}> <ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ zIndex: 99 }}>
View transaction on Etherscan <Trans id="transaction.viewOnEherscan">View transaction on Etherscan</Trans>
</ExternalLink> </ExternalLink>
)} )}
</AutoColumn> </AutoColumn>
......
...@@ -17,6 +17,7 @@ import { ButtonPrimary } from '../Button' ...@@ -17,6 +17,7 @@ import { ButtonPrimary } from '../Button'
import { AutoColumn, ColumnCenter } from '../Column' import { AutoColumn, ColumnCenter } from '../Column'
import Confetti from '../Confetti' import Confetti from '../Confetti'
import { Break, CardBGImage, CardBGImageSmaller, CardNoise, CardSection, DataCard } from '../earn/styled' import { Break, CardBGImage, CardBGImageSmaller, CardNoise, CardSection, DataCard } from '../earn/styled'
import { Trans } from '@lingui/macro'
import Modal from '../Modal' import Modal from '../Modal'
import { RowBetween } from '../Row' import { RowBetween } from '../Row'
...@@ -99,11 +100,15 @@ export default function ClaimModal() { ...@@ -99,11 +100,15 @@ export default function ClaimModal() {
<CardNoise /> <CardNoise />
<CardSection gap="md"> <CardSection gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={500}>Claim UNI</TYPE.white> <TYPE.white fontWeight={500}>
<Trans id="claim.buttons.claimUNI">Claim UNI</Trans>
</TYPE.white>
<CloseIcon onClick={toggleClaimModal} style={{ zIndex: 99 }} color="white" /> <CloseIcon onClick={toggleClaimModal} style={{ zIndex: 99 }} color="white" />
</RowBetween> </RowBetween>
<TYPE.white fontWeight={700} fontSize={36}> <TYPE.white fontWeight={700} fontSize={36}>
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI <Trans id="claim.labels.tokenAmount">
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
</Trans>
</TYPE.white> </TYPE.white>
</CardSection> </CardSection>
<Break /> <Break />
...@@ -111,34 +116,48 @@ export default function ClaimModal() { ...@@ -111,34 +116,48 @@ export default function ClaimModal() {
{userClaimData?.flags?.isSOCKS && ( {userClaimData?.flags?.isSOCKS && (
<RowBetween> <RowBetween>
<TYPE.subHeader color="white">SOCKS</TYPE.subHeader> <TYPE.subHeader color="white">SOCKS</TYPE.subHeader>
<TYPE.subHeader color="white">{SOCKS_AMOUNT} UNI</TYPE.subHeader> <TYPE.subHeader color="white">
<Trans id="claim.labels.socksAmount">{SOCKS_AMOUNT} UNI</Trans>
</TYPE.subHeader>
</RowBetween> </RowBetween>
)} )}
{userClaimData?.flags?.isLP && {userClaimData?.flags?.isLP &&
unclaimedAmount && unclaimedAmount &&
JSBI.greaterThanOrEqual(unclaimedAmount.quotient, nonLPAmount) && ( JSBI.greaterThanOrEqual(unclaimedAmount.quotient, nonLPAmount) && (
<RowBetween> <RowBetween>
<TYPE.subHeader color="white">Liquidity</TYPE.subHeader>
<TYPE.subHeader color="white"> <TYPE.subHeader color="white">
{unclaimedAmount <Trans id="common.liquidity">Liquidity</Trans>
.subtract(CurrencyAmount.fromRawAmount(unclaimedAmount.currency, nonLPAmount)) </TYPE.subHeader>
.toFixed(0, { groupSeparator: ',' })}{' '} <TYPE.subHeader color="white">
UNI <Trans id="claim.labels.tokenAmount">
{unclaimedAmount
.subtract(CurrencyAmount.fromRawAmount(unclaimedAmount.currency, nonLPAmount))
.toFixed(0, { groupSeparator: ',' })}{' '}
UNI
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
</RowBetween> </RowBetween>
)} )}
{userClaimData?.flags?.isUser && ( {userClaimData?.flags?.isUser && (
<RowBetween> <RowBetween>
<TYPE.subHeader color="white">User</TYPE.subHeader> <TYPE.subHeader color="white">
<TYPE.subHeader color="white">{USER_AMOUNT} UNI</TYPE.subHeader> <Trans id="common.user">User</Trans>
</TYPE.subHeader>
<TYPE.subHeader color="white">
<Trans id="claim.userAmount">{USER_AMOUNT} UNI</Trans>
</TYPE.subHeader>
</RowBetween> </RowBetween>
)} )}
</CardSection> </CardSection>
</ModalUpper> </ModalUpper>
<AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center"> <AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center">
<TYPE.subHeader fontWeight={500}> <TYPE.subHeader fontWeight={500}>
As a member of the Uniswap community you may claim UNI to be used for voting and governance. <br /> <br /> <Trans id="claim.hints.uniswapCommunityMember">
<ExternalLink href="https://uniswap.org/blog/uni">Read more about UNI</ExternalLink> As a member of the Uniswap community you may claim UNI to be used for voting and governance.
<br />
<br />
<ExternalLink href="https://uniswap.org/blog/uni">Read more about UNI</ExternalLink>
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
<ButtonPrimary <ButtonPrimary
disabled={!isAddress(account ?? '')} disabled={!isAddress(account ?? '')}
...@@ -148,7 +167,7 @@ export default function ClaimModal() { ...@@ -148,7 +167,7 @@ export default function ClaimModal() {
mt="1rem" mt="1rem"
onClick={onClaim} onClick={onClaim}
> >
Claim UNI <Trans id="claim.buttons.claimUNI">Claim UNI</Trans>
</ButtonPrimary> </ButtonPrimary>
</AutoColumn> </AutoColumn>
</ContentWrapper> </ContentWrapper>
...@@ -165,7 +184,7 @@ export default function ClaimModal() { ...@@ -165,7 +184,7 @@ export default function ClaimModal() {
{!claimConfirmed ? ( {!claimConfirmed ? (
<CustomLightSpinner src={Circle} alt="loader" size={'90px'} /> <CustomLightSpinner src={Circle} alt="loader" size={'90px'} />
) : ( ) : (
<UniTokenAnimated width="72px" src={tokenLogo} /> <UniTokenAnimated width="72px" src={tokenLogo} alt="UNI" />
)} )}
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="100px" justify={'center'}> <AutoColumn gap="100px" justify={'center'}>
...@@ -175,32 +194,38 @@ export default function ClaimModal() { ...@@ -175,32 +194,38 @@ export default function ClaimModal() {
</TYPE.largeHeader> </TYPE.largeHeader>
{!claimConfirmed && ( {!claimConfirmed && (
<Text fontSize={36} color={'#ff007a'} fontWeight={800}> <Text fontSize={36} color={'#ff007a'} fontWeight={800}>
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI <Trans id="claim.labels.tokenAmount">
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
</Trans>
</Text> </Text>
)} )}
</AutoColumn> </AutoColumn>
{claimConfirmed && ( {claimConfirmed && (
<> <>
<TYPE.subHeader fontWeight={500} color="black"> <TYPE.subHeader fontWeight={500} color="black">
<span role="img" aria-label="party-hat"> <Trans id="claim.labels.welcome">
🎉{' '} <span role="img" aria-label="party-hat">
</span> 🎉{' '}
Welcome to team Unicorn :){' '} </span>
<span role="img" aria-label="party-hat"> Welcome to team Unicorn :){' '}
🎉 <span role="img" aria-label="party-hat">
</span> 🎉
</span>
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
</> </>
)} )}
{attempting && !claimSubmitted && ( {attempting && !claimSubmitted && (
<TYPE.subHeader color="black">Confirm this transaction in your wallet</TYPE.subHeader> <TYPE.subHeader color="black">
<Trans id="claim.labels.confirmTransactionInWallet">Confirm this transaction in your wallet</Trans>
</TYPE.subHeader>
)} )}
{attempting && claimSubmitted && !claimConfirmed && chainId && claimTxn?.hash && ( {attempting && claimSubmitted && !claimConfirmed && chainId && claimTxn?.hash && (
<ExternalLink <ExternalLink
href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)} href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)}
style={{ zIndex: 99 }} style={{ zIndex: 99 }}
> >
View transaction on Etherscan <Trans id="transaction.viewOnEherscan">View transaction on Etherscan</Trans>
</ExternalLink> </ExternalLink>
)} )}
</AutoColumn> </AutoColumn>
......
...@@ -11,6 +11,7 @@ import { SubmittedView, LoadingView } from '../ModalViews' ...@@ -11,6 +11,7 @@ import { SubmittedView, LoadingView } from '../ModalViews'
import { TransactionResponse } from '@ethersproject/providers' import { TransactionResponse } from '@ethersproject/providers'
import { useTransactionAdder } from '../../state/transactions/hooks' import { useTransactionAdder } from '../../state/transactions/hooks'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { t, Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -46,7 +47,10 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta ...@@ -46,7 +47,10 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
.getReward({ gasLimit: 350000 }) .getReward({ gasLimit: 350000 })
.then((response: TransactionResponse) => { .then((response: TransactionResponse) => {
addTransaction(response, { addTransaction(response, {
summary: `Claim accumulated UNI rewards`, summary: t({
id: 'transactions.summary.claimAccumulatedUNIRewards',
message: 'Claim accumulated UNI rewards',
}),
}) })
setHash(response.hash) setHash(response.hash)
}) })
...@@ -59,10 +63,10 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta ...@@ -59,10 +63,10 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
let error: string | undefined let error: string | undefined
if (!account) { if (!account) {
error = 'Connect Wallet' error = t({ id: 'wallet.connect' })
} }
if (!stakingInfo?.stakedAmount) { if (!stakingInfo?.stakedAmount) {
error = error ?? 'Enter an amount' error = error ?? t({ id: 'earn.enterAmountError', message: 'Enter an amount' })
} }
return ( return (
...@@ -70,7 +74,9 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta ...@@ -70,7 +74,9 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
{!attempting && !hash && ( {!attempting && !hash && (
<ContentWrapper gap="lg"> <ContentWrapper gap="lg">
<RowBetween> <RowBetween>
<TYPE.mediumHeader>Claim</TYPE.mediumHeader> <TYPE.mediumHeader>
<Trans id="earn.claim.label">Claim</Trans>
</TYPE.mediumHeader>
<CloseIcon onClick={wrappedOnDismiss} /> <CloseIcon onClick={wrappedOnDismiss} />
</RowBetween> </RowBetween>
{stakingInfo?.earnedAmount && ( {stakingInfo?.earnedAmount && (
...@@ -78,29 +84,39 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta ...@@ -78,29 +84,39 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
<TYPE.body fontWeight={600} fontSize={36}> <TYPE.body fontWeight={600} fontSize={36}>
{stakingInfo?.earnedAmount?.toSignificant(6)} {stakingInfo?.earnedAmount?.toSignificant(6)}
</TYPE.body> </TYPE.body>
<TYPE.body>Unclaimed UNI</TYPE.body> <TYPE.body>
<Trans id="earn.claim.unclaimedUNI">Unclaimed UNI</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
)} )}
<TYPE.subHeader style={{ textAlign: 'center' }}> <TYPE.subHeader style={{ textAlign: 'center' }}>
When you claim without withdrawing your liquidity remains in the mining pool. <Trans id="earn.claim.withoutWithdrawingHint">
When you claim without withdrawing your liquidity remains in the mining pool.
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
<ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onClaimReward}> <ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onClaimReward}>
{error ?? 'Claim'} {error ?? <Trans id="earn.claim.label">Claim</Trans>}
</ButtonError> </ButtonError>
</ContentWrapper> </ContentWrapper>
)} )}
{attempting && !hash && ( {attempting && !hash && (
<LoadingView onDismiss={wrappedOnDismiss}> <LoadingView onDismiss={wrappedOnDismiss}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.body fontSize={20}>Claiming {stakingInfo?.earnedAmount?.toSignificant(6)} UNI</TYPE.body> <TYPE.body fontSize={20}>
<Trans id="claim.labels.claimingAmount">Claiming {stakingInfo?.earnedAmount?.toSignificant(6)} UNI</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</LoadingView> </LoadingView>
)} )}
{hash && ( {hash && (
<SubmittedView onDismiss={wrappedOnDismiss} hash={hash}> <SubmittedView onDismiss={wrappedOnDismiss} hash={hash}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader> <TYPE.largeHeader>
<TYPE.body fontSize={20}>Claimed UNI!</TYPE.body> <Trans id="transactions.submitted">Transaction Submitted</Trans>
</TYPE.largeHeader>
<TYPE.body fontSize={20}>
<Trans id="earn.claim.claimedUNI">Claimed UNI!</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</SubmittedView> </SubmittedView>
)} )}
......
...@@ -16,6 +16,7 @@ import { useTotalSupply } from '../../hooks/useTotalSupply' ...@@ -16,6 +16,7 @@ import { useTotalSupply } from '../../hooks/useTotalSupply'
import { useV2Pair } from '../../hooks/useV2Pairs' import { useV2Pair } from '../../hooks/useV2Pairs'
import useUSDCPrice from '../../hooks/useUSDCPrice' import useUSDCPrice from '../../hooks/useUSDCPrice'
import { BIG_INT_SECONDS_IN_WEEK } from '../../constants/misc' import { BIG_INT_SECONDS_IN_WEEK } from '../../constants/misc'
import { Trans } from '@lingui/macro'
const StatContainer = styled.div` const StatContainer = styled.div`
display: flex; display: flex;
...@@ -120,30 +121,45 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo }) ...@@ -120,30 +121,45 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
<StyledInternalLink to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`} style={{ width: '100%' }}> <StyledInternalLink to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`} style={{ width: '100%' }}>
<ButtonPrimary padding="8px" borderRadius="8px"> <ButtonPrimary padding="8px" borderRadius="8px">
{isStaking ? 'Manage' : 'Deposit'} {isStaking ? <Trans id="earn.pool.manage">Manage</Trans> : <Trans id="earn.pool.deposit">Deposit</Trans>}
</ButtonPrimary> </ButtonPrimary>
</StyledInternalLink> </StyledInternalLink>
</TopSection> </TopSection>
<StatContainer> <StatContainer>
<RowBetween> <RowBetween>
<TYPE.white> Total deposited</TYPE.white>
<TYPE.white> <TYPE.white>
{valueOfTotalStakedAmountInUSDC <Trans id="earn.pool.totalDeposited">Total deposited</Trans>
? `$${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}` </TYPE.white>
: `${valueOfTotalStakedAmountInWETH?.toSignificant(4, { groupSeparator: ',' }) ?? '-'} ETH`} <TYPE.white>
{valueOfTotalStakedAmountInUSDC ? (
<Trans id="earn.pool.valueInUSDC">
${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}
</Trans>
) : (
<Trans id="earn.pool.valueInETH">
${valueOfTotalStakedAmountInWETH?.toSignificant(4, { groupSeparator: ',' }) ?? '-'} ETH
</Trans>
)}
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white> Pool rate </TYPE.white>
<TYPE.white> <TYPE.white>
{stakingInfo <Trans id="earn.pool.rate">Pool rate</Trans>
? stakingInfo.active </TYPE.white>
? `${stakingInfo.totalRewardRate <TYPE.white>
?.multiply(BIG_INT_SECONDS_IN_WEEK) {stakingInfo ? (
?.toFixed(0, { groupSeparator: ',' })} UNI / week` stakingInfo.active ? (
: '0 UNI / week' <Trans id="earn.pool.rewardRate">
: '-'} {stakingInfo.totalRewardRate?.multiply(BIG_INT_SECONDS_IN_WEEK)?.toFixed(0, { groupSeparator: ',' })}{' '}
UNI / week
</Trans>
) : (
<Trans id="earn.pool.noRewardRate">0 UNI / week</Trans>
)
) : (
'-'
)}
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
</StatContainer> </StatContainer>
...@@ -153,20 +169,29 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo }) ...@@ -153,20 +169,29 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
<Break /> <Break />
<BottomSection showBackground={true}> <BottomSection showBackground={true}>
<TYPE.black color={'white'} fontWeight={500}> <TYPE.black color={'white'} fontWeight={500}>
<span>Your rate</span> <span>
<Trans id="earn.pool.yourRate">Your rate</Trans>
</span>
</TYPE.black> </TYPE.black>
<TYPE.black style={{ textAlign: 'right' }} color={'white'} fontWeight={500}> <TYPE.black style={{ textAlign: 'right' }} color={'white'} fontWeight={500}>
<span role="img" aria-label="wizard-icon" style={{ marginRight: '0.5rem' }}> <span role="img" aria-label="wizard-icon" style={{ marginRight: '0.5rem' }}>
</span> </span>
{stakingInfo {stakingInfo ? (
? stakingInfo.active stakingInfo.active ? (
? `${stakingInfo.rewardRate <Trans id="earn.pool.rewardRate">
{stakingInfo.rewardRate
?.multiply(BIG_INT_SECONDS_IN_WEEK) ?.multiply(BIG_INT_SECONDS_IN_WEEK)
?.toSignificant(4, { groupSeparator: ',' })} UNI / week` ?.toSignificant(4, { groupSeparator: ',' })}{' '}
: '0 UNI / week' UNI / week
: '-'} </Trans>
) : (
<Trans id="earn.pool.noRewardRate">0 UNI / week</Trans>
)
) : (
'-'
)}
</TYPE.black> </TYPE.black>
</BottomSection> </BottomSection>
</> </>
......
...@@ -19,6 +19,7 @@ import { StakingInfo, useDerivedStakeInfo } from '../../state/stake/hooks' ...@@ -19,6 +19,7 @@ import { StakingInfo, useDerivedStakeInfo } from '../../state/stake/hooks'
import { TransactionResponse } from '@ethersproject/providers' import { TransactionResponse } from '@ethersproject/providers'
import { useTransactionAdder } from '../../state/transactions/hooks' import { useTransactionAdder } from '../../state/transactions/hooks'
import { LoadingView, SubmittedView } from '../ModalViews' import { LoadingView, SubmittedView } from '../ModalViews'
import { t, Trans } from '@lingui/macro'
const HypotheticalRewardRate = styled.div<{ dim: boolean }>` const HypotheticalRewardRate = styled.div<{ dim: boolean }>`
display: flex; display: flex;
...@@ -103,7 +104,7 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui ...@@ -103,7 +104,7 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
) )
.then((response: TransactionResponse) => { .then((response: TransactionResponse) => {
addTransaction(response, { addTransaction(response, {
summary: `Deposit liquidity`, summary: t({ id: 'transactions.summary.depositLiquidity', message: 'Deposit liquidity' }),
}) })
setHash(response.hash) setHash(response.hash)
}) })
...@@ -153,7 +154,9 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui ...@@ -153,7 +154,9 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
{!attempting && !hash && ( {!attempting && !hash && (
<ContentWrapper gap="lg"> <ContentWrapper gap="lg">
<RowBetween> <RowBetween>
<TYPE.mediumHeader>Deposit</TYPE.mediumHeader> <TYPE.mediumHeader>
<Trans id="common.deposit">Deposit</Trans>
</TYPE.mediumHeader>
<CloseIcon onClick={wrappedOnDismiss} /> <CloseIcon onClick={wrappedOnDismiss} />
</RowBetween> </RowBetween>
<CurrencyInputPanel <CurrencyInputPanel
...@@ -164,18 +167,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui ...@@ -164,18 +167,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
currency={stakingInfo.stakedAmount.currency} currency={stakingInfo.stakedAmount.currency}
pair={dummyPair} pair={dummyPair}
label={''} label={''}
customBalanceText={'Available to deposit: '} customBalanceText={t({ id: 'earn.customBalanceText', message: 'Available to deposit: ' })}
id="stake-liquidity-token" id="stake-liquidity-token"
/> />
<HypotheticalRewardRate dim={!hypotheticalRewardRate.greaterThan('0')}> <HypotheticalRewardRate dim={!hypotheticalRewardRate.greaterThan('0')}>
<div> <div>
<TYPE.black fontWeight={600}>Weekly Rewards</TYPE.black> <TYPE.black fontWeight={600}>
<Trans id="earn.weeklyRewardsHeading">Weekly Rewards</Trans>
</TYPE.black>
</div> </div>
<TYPE.black> <TYPE.black>
{hypotheticalRewardRate.multiply((60 * 60 * 24 * 7).toString()).toSignificant(4, { groupSeparator: ',' })}{' '} <Trans id="earn.pool.rewardRate">
UNI / week {hypotheticalRewardRate
.multiply((60 * 60 * 24 * 7).toString())
.toSignificant(4, { groupSeparator: ',' })}{' '}
UNI / week
</Trans>
</TYPE.black> </TYPE.black>
</HypotheticalRewardRate> </HypotheticalRewardRate>
...@@ -186,14 +195,14 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui ...@@ -186,14 +195,14 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
confirmed={approval === ApprovalState.APPROVED || signatureData !== null} confirmed={approval === ApprovalState.APPROVED || signatureData !== null}
disabled={approval !== ApprovalState.NOT_APPROVED || signatureData !== null} disabled={approval !== ApprovalState.NOT_APPROVED || signatureData !== null}
> >
Approve <Trans id="common.approve">Approve</Trans>
</ButtonConfirmed> </ButtonConfirmed>
<ButtonError <ButtonError
disabled={!!error || (signatureData === null && approval !== ApprovalState.APPROVED)} disabled={!!error || (signatureData === null && approval !== ApprovalState.APPROVED)}
error={!!error && !!parsedAmount} error={!!error && !!parsedAmount}
onClick={onStake} onClick={onStake}
> >
{error ?? 'Deposit'} {error ?? <Trans id="common.deposit">Deposit</Trans>}
</ButtonError> </ButtonError>
</RowBetween> </RowBetween>
<ProgressCircles steps={[approval === ApprovalState.APPROVED || signatureData !== null]} disabled={true} /> <ProgressCircles steps={[approval === ApprovalState.APPROVED || signatureData !== null]} disabled={true} />
...@@ -202,16 +211,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui ...@@ -202,16 +211,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
{attempting && !hash && ( {attempting && !hash && (
<LoadingView onDismiss={wrappedOnDismiss}> <LoadingView onDismiss={wrappedOnDismiss}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Depositing Liquidity</TYPE.largeHeader> <TYPE.largeHeader>
<TYPE.body fontSize={20}>{parsedAmount?.toSignificant(4)} UNI-V2</TYPE.body> <Trans id="common.depositingLiquidity">Depositing Liquidity</Trans>
</TYPE.largeHeader>
<TYPE.body fontSize={20}>
<Trans id="currencies.amountUNIV2">{parsedAmount?.toSignificant(4)} UNI-V2</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</LoadingView> </LoadingView>
)} )}
{attempting && hash && ( {attempting && hash && (
<SubmittedView onDismiss={wrappedOnDismiss} hash={hash}> <SubmittedView onDismiss={wrappedOnDismiss} hash={hash}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader> <TYPE.largeHeader>
<TYPE.body fontSize={20}>Deposited {parsedAmount?.toSignificant(4)} UNI-V2</TYPE.body> <Trans id="transactions.submitted">Transaction Submitted</Trans>
</TYPE.largeHeader>
<TYPE.body fontSize={20}>
<Trans id="currencies.depositedUNIV2">Deposited {parsedAmount?.toSignificant(4)} UNI-V2</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</SubmittedView> </SubmittedView>
)} )}
......
...@@ -12,6 +12,7 @@ import { TransactionResponse } from '@ethersproject/providers' ...@@ -12,6 +12,7 @@ import { TransactionResponse } from '@ethersproject/providers'
import { useTransactionAdder } from '../../state/transactions/hooks' import { useTransactionAdder } from '../../state/transactions/hooks'
import FormattedCurrencyAmount from '../FormattedCurrencyAmount' import FormattedCurrencyAmount from '../FormattedCurrencyAmount'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { t, Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -47,7 +48,10 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki ...@@ -47,7 +48,10 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
.exit({ gasLimit: 300000 }) .exit({ gasLimit: 300000 })
.then((response: TransactionResponse) => { .then((response: TransactionResponse) => {
addTransaction(response, { addTransaction(response, {
summary: `Withdraw deposited liquidity`, summary: t({
id: 'transactions.summary.withdrawDepositedLiquidity',
message: 'Withdraw deposited liquidity',
}),
}) })
setHash(response.hash) setHash(response.hash)
}) })
...@@ -60,10 +64,10 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki ...@@ -60,10 +64,10 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
let error: string | undefined let error: string | undefined
if (!account) { if (!account) {
error = 'Connect Wallet' error = t({ id: 'wallet.connect', message: 'Connect a wallet' })
} }
if (!stakingInfo?.stakedAmount) { if (!stakingInfo?.stakedAmount) {
error = error ?? 'Enter an amount' error = error ?? t({ id: 'earn.enterAnAmountError', message: 'Enter an amount' })
} }
return ( return (
...@@ -71,7 +75,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki ...@@ -71,7 +75,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
{!attempting && !hash && ( {!attempting && !hash && (
<ContentWrapper gap="lg"> <ContentWrapper gap="lg">
<RowBetween> <RowBetween>
<TYPE.mediumHeader>Withdraw</TYPE.mediumHeader> <TYPE.mediumHeader>
<Trans id="earn.unstake.withdraw">Withdraw</Trans>
</TYPE.mediumHeader>
<CloseIcon onClick={wrappedOndismiss} /> <CloseIcon onClick={wrappedOndismiss} />
</RowBetween> </RowBetween>
{stakingInfo?.stakedAmount && ( {stakingInfo?.stakedAmount && (
...@@ -79,7 +85,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki ...@@ -79,7 +85,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
<TYPE.body fontWeight={600} fontSize={36}> <TYPE.body fontWeight={600} fontSize={36}>
{<FormattedCurrencyAmount currencyAmount={stakingInfo.stakedAmount} />} {<FormattedCurrencyAmount currencyAmount={stakingInfo.stakedAmount} />}
</TYPE.body> </TYPE.body>
<TYPE.body>Deposited liquidity:</TYPE.body> <TYPE.body>
<Trans id="earn.unstake.depositedLiquidity">Deposited liquidity:</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
)} )}
{stakingInfo?.earnedAmount && ( {stakingInfo?.earnedAmount && (
...@@ -87,31 +95,47 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki ...@@ -87,31 +95,47 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
<TYPE.body fontWeight={600} fontSize={36}> <TYPE.body fontWeight={600} fontSize={36}>
{<FormattedCurrencyAmount currencyAmount={stakingInfo?.earnedAmount} />} {<FormattedCurrencyAmount currencyAmount={stakingInfo?.earnedAmount} />}
</TYPE.body> </TYPE.body>
<TYPE.body>Unclaimed UNI</TYPE.body> <TYPE.body>
<Trans id="earn.claim.unclaimedUNI">Unclaimed UNI</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
)} )}
<TYPE.subHeader style={{ textAlign: 'center' }}> <TYPE.subHeader style={{ textAlign: 'center' }}>
When you withdraw, your UNI is claimed and your liquidity is removed from the mining pool. <Trans id="earn.unstake.hint">
When you withdraw, your UNI is claimed and your liquidity is removed from the mining pool.
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
<ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onWithdraw}> <ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onWithdraw}>
{error ?? 'Withdraw & Claim'} {error ?? <Trans id="earn.unstake.withdrawAndClaim">Withdraw & Claim</Trans>}
</ButtonError> </ButtonError>
</ContentWrapper> </ContentWrapper>
)} )}
{attempting && !hash && ( {attempting && !hash && (
<LoadingView onDismiss={wrappedOndismiss}> <LoadingView onDismiss={wrappedOndismiss}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.body fontSize={20}>Withdrawing {stakingInfo?.stakedAmount?.toSignificant(4)} UNI-V2</TYPE.body> <TYPE.body fontSize={20}>
<TYPE.body fontSize={20}>Claiming {stakingInfo?.earnedAmount?.toSignificant(4)} UNI</TYPE.body> <Trans id="earn.labels.withdrawingUNIV2">
Withdrawing {stakingInfo?.stakedAmount?.toSignificant(4)} UNI-V2
</Trans>
</TYPE.body>
<TYPE.body fontSize={20}>
<Trans id="earn.labels.claimingUNI">Claiming {stakingInfo?.earnedAmount?.toSignificant(4)} UNI</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</LoadingView> </LoadingView>
)} )}
{hash && ( {hash && (
<SubmittedView onDismiss={wrappedOndismiss} hash={hash}> <SubmittedView onDismiss={wrappedOndismiss} hash={hash}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader> <TYPE.largeHeader>
<TYPE.body fontSize={20}>Withdrew UNI-V2!</TYPE.body> <Trans id="transaction.submitted">Transaction Submitted</Trans>
<TYPE.body fontSize={20}>Claimed UNI!</TYPE.body> </TYPE.largeHeader>
<TYPE.body fontSize={20}>
<Trans id="earn.labels.withdrewUNIV2">Withdrew UNI-V2!</Trans>
</TYPE.body>
<TYPE.body fontSize={20}>
<Trans id="earn.labels.claimedUNI">Claimed UNI!</Trans>
</TYPE.body>
</AutoColumn> </AutoColumn>
</SubmittedView> </SubmittedView>
)} )}
......
...@@ -15,6 +15,7 @@ import { FiatValue } from '../CurrencyInputPanel/FiatValue' ...@@ -15,6 +15,7 @@ import { FiatValue } from '../CurrencyInputPanel/FiatValue'
import CurrencyLogo from '../CurrencyLogo' import CurrencyLogo from '../CurrencyLogo'
import { RowBetween, RowFixed } from '../Row' import { RowBetween, RowFixed } from '../Row'
import { TruncatedText, SwapShowAcceptChanges } from './styleds' import { TruncatedText, SwapShowAcceptChanges } from './styleds'
import { Trans } from '@lingui/macro'
import { AdvancedSwapDetails } from './AdvancedSwapDetails' import { AdvancedSwapDetails } from './AdvancedSwapDetails'
import { LightCard } from '../Card' import { LightCard } from '../Card'
...@@ -64,7 +65,7 @@ export default function SwapModalHeader({ ...@@ -64,7 +65,7 @@ export default function SwapModalHeader({
<AutoColumn gap={'8px'}> <AutoColumn gap={'8px'}>
<RowBetween> <RowBetween>
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
From <Trans id="swap.fromCurrency">From</Trans>
</TYPE.body> </TYPE.body>
<FiatValue fiatValue={fiatValueInput} /> <FiatValue fiatValue={fiatValueInput} />
</RowBetween> </RowBetween>
...@@ -94,7 +95,7 @@ export default function SwapModalHeader({ ...@@ -94,7 +95,7 @@ export default function SwapModalHeader({
<AutoColumn gap={'8px'}> <AutoColumn gap={'8px'}>
<RowBetween> <RowBetween>
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
To <Trans id="swap.toCurrency">To</Trans>
</TYPE.body> </TYPE.body>
<TYPE.body fontSize={14} color={theme.text3}> <TYPE.body fontSize={14} color={theme.text3}>
<FiatValue <FiatValue
...@@ -134,13 +135,15 @@ export default function SwapModalHeader({ ...@@ -134,13 +135,15 @@ export default function SwapModalHeader({
<RowBetween> <RowBetween>
<RowFixed> <RowFixed>
<AlertTriangle size={20} style={{ marginRight: '8px', minWidth: 24 }} /> <AlertTriangle size={20} style={{ marginRight: '8px', minWidth: 24 }} />
<TYPE.main color={theme.primary1}> Price Updated</TYPE.main> <TYPE.main color={theme.primary1}>
<Trans id="swap.priceUpdated">Price Updated</Trans>
</TYPE.main>
</RowFixed> </RowFixed>
<ButtonPrimary <ButtonPrimary
style={{ padding: '.5rem', width: 'fit-content', fontSize: '0.825rem', borderRadius: '12px' }} style={{ padding: '.5rem', width: 'fit-content', fontSize: '0.825rem', borderRadius: '12px' }}
onClick={onAcceptChanges} onClick={onAcceptChanges}
> >
Accept <Trans id="common.accept">Accept</Trans>
</ButtonPrimary> </ButtonPrimary>
</RowBetween> </RowBetween>
</SwapShowAcceptChanges> </SwapShowAcceptChanges>
...@@ -149,27 +152,33 @@ export default function SwapModalHeader({ ...@@ -149,27 +152,33 @@ export default function SwapModalHeader({
<AutoColumn justify="flex-start" gap="sm" style={{ padding: '.75rem 1rem' }}> <AutoColumn justify="flex-start" gap="sm" style={{ padding: '.75rem 1rem' }}>
{trade.tradeType === TradeType.EXACT_INPUT ? ( {trade.tradeType === TradeType.EXACT_INPUT ? (
<TYPE.italic fontWeight={400} textAlign="left" style={{ width: '100%' }}> <TYPE.italic fontWeight={400} textAlign="left" style={{ width: '100%' }}>
{`Output is estimated. You will receive at least `} <Trans id="swap.outputEstimatedHint">
<b> Output is estimated. You will receive at least{' '}
{trade.minimumAmountOut(allowedSlippage).toSignificant(6)} {trade.outputAmount.currency.symbol} <b>
</b> {trade.minimumAmountOut(allowedSlippage).toSignificant(6)} {trade.outputAmount.currency.symbol}
{' or the transaction will revert.'} </b>{' '}
or the transaction will revert.
</Trans>
</TYPE.italic> </TYPE.italic>
) : ( ) : (
<TYPE.italic fontWeight={400} textAlign="left" style={{ width: '100%' }}> <TYPE.italic fontWeight={400} textAlign="left" style={{ width: '100%' }}>
{`Input is estimated. You will sell at most `} <Trans id="swap.inputEstimated.hint">
<b> Input is estimated. You will sell at most{' '}
{trade.maximumAmountIn(allowedSlippage).toSignificant(6)} {trade.inputAmount.currency.symbol} <b>
</b> {trade.maximumAmountIn(allowedSlippage).toSignificant(6)} {trade.inputAmount.currency.symbol}
{' or the transaction will revert.'} </b>{' '}
or the transaction will revert.
</Trans>
</TYPE.italic> </TYPE.italic>
)} )}
</AutoColumn> </AutoColumn>
{recipient !== null ? ( {recipient !== null ? (
<AutoColumn justify="flex-start" gap="sm" style={{ padding: '12px 0 0 0px' }}> <AutoColumn justify="flex-start" gap="sm" style={{ padding: '12px 0 0 0px' }}>
<TYPE.main> <TYPE.main>
Output will be sent to{' '} <Trans id="swap.outputRecipient">
<b title={recipient}>{isAddress(recipient) ? shortenAddress(recipient) : recipient}</b> Output will be sent to{' '}
<b title={recipient}>{isAddress(recipient) ? shortenAddress(recipient) : recipient}</b>
</Trans>
</TYPE.main> </TYPE.main>
</AutoColumn> </AutoColumn>
) : null} ) : null}
......
...@@ -11,6 +11,7 @@ import { useActiveWeb3React } from 'hooks/web3' ...@@ -11,6 +11,7 @@ import { useActiveWeb3React } from 'hooks/web3'
import { Currency, Token } from '@uniswap/sdk-core' import { Currency, Token } from '@uniswap/sdk-core'
import { useUnsupportedTokens } from '../../hooks/Tokens' import { useUnsupportedTokens } from '../../hooks/Tokens'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import { Trans } from '@lingui/macro'
const DetailsFooter = styled.div<{ show: boolean }>` const DetailsFooter = styled.div<{ show: boolean }>`
padding-top: calc(16px + 2rem); padding-top: calc(16px + 2rem);
...@@ -62,7 +63,9 @@ export default function UnsupportedCurrencyFooter({ ...@@ -62,7 +63,9 @@ export default function UnsupportedCurrencyFooter({
<Card padding="2rem"> <Card padding="2rem">
<AutoColumn gap="lg"> <AutoColumn gap="lg">
<RowBetween> <RowBetween>
<TYPE.mediumHeader>Unsupported Assets</TYPE.mediumHeader> <TYPE.mediumHeader>
<Trans id="errors.unsuportedAssets">Unsupported Assets</Trans>
</TYPE.mediumHeader>
<CloseIcon onClick={() => setShowDetails(false)} /> <CloseIcon onClick={() => setShowDetails(false)} />
</RowBetween> </RowBetween>
{tokens.map((token) => { {tokens.map((token) => {
...@@ -88,15 +91,19 @@ export default function UnsupportedCurrencyFooter({ ...@@ -88,15 +91,19 @@ export default function UnsupportedCurrencyFooter({
})} })}
<AutoColumn gap="lg"> <AutoColumn gap="lg">
<TYPE.body fontWeight={500}> <TYPE.body fontWeight={500}>
Some assets are not available through this interface because they may not work well with the smart <Trans id="swap.unsupportedAssetsHint">
contracts or we are unable to allow trading for legal reasons. Some assets are not available through this interface because they may not work well with the smart
contracts or we are unable to allow trading for legal reasons.
</Trans>
</TYPE.body> </TYPE.body>
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
</Card> </Card>
</Modal> </Modal>
<ButtonEmpty padding={'0'} onClick={() => setShowDetails(true)}> <ButtonEmpty padding={'0'} onClick={() => setShowDetails(true)}>
<TYPE.blue>Read more about unsupported assets</TYPE.blue> <TYPE.blue>
<Trans id="swap.buttons.readMoreUnsupportedAssets">Read more about unsupported assets</Trans>
</TYPE.blue>
</ButtonEmpty> </ButtonEmpty>
</DetailsFooter> </DetailsFooter>
) )
......
...@@ -16,6 +16,7 @@ import { useDelegateCallback } from '../../state/governance/hooks' ...@@ -16,6 +16,7 @@ import { useDelegateCallback } from '../../state/governance/hooks'
import { useTokenBalance } from '../../state/wallet/hooks' import { useTokenBalance } from '../../state/wallet/hooks'
import { LoadingView, SubmittedView } from '../ModalViews' import { LoadingView, SubmittedView } from '../ModalViews'
import { formatTokenAmount } from 'utils/formatTokenAmount' import { formatTokenAmount } from 'utils/formatTokenAmount'
import { Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -97,17 +98,31 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro ...@@ -97,17 +98,31 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro
<TYPE.mediumHeader fontWeight={500}>{title}</TYPE.mediumHeader> <TYPE.mediumHeader fontWeight={500}>{title}</TYPE.mediumHeader>
<StyledClosed stroke="black" onClick={wrappedOndismiss} /> <StyledClosed stroke="black" onClick={wrappedOndismiss} />
</RowBetween> </RowBetween>
<TYPE.body>Earned UNI tokens represent voting shares in Uniswap governance.</TYPE.body>
<TYPE.body> <TYPE.body>
You can either vote on each proposal yourself or delegate your votes to a third party. <Trans id="vote.delegate.hint1">Earned UNI tokens represent voting shares in Uniswap governance.</Trans>
</TYPE.body>
<TYPE.body>
<Trans id="vote.delegate.hint2">
You can either vote on each proposal yourself or delegate your votes to a third party.
</Trans>
</TYPE.body> </TYPE.body>
{usingDelegate && <AddressInputPanel value={typed} onChange={handleRecipientType} />} {usingDelegate && <AddressInputPanel value={typed} onChange={handleRecipientType} />}
<ButtonPrimary disabled={!isAddress(parsedAddress ?? '')} onClick={onDelegate}> <ButtonPrimary disabled={!isAddress(parsedAddress ?? '')} onClick={onDelegate}>
<TYPE.mediumHeader color="white">{usingDelegate ? 'Delegate Votes' : 'Self Delegate'}</TYPE.mediumHeader> <TYPE.mediumHeader color="white">
{usingDelegate ? (
<Trans id="vote.delegate.delegateVotes">Delegate Votes</Trans>
) : (
<Trans id="vote.delegate.selfDelegate">Self Delegate</Trans>
)}
</TYPE.mediumHeader>
</ButtonPrimary> </ButtonPrimary>
<TextButton onClick={() => setUsingDelegate(!usingDelegate)}> <TextButton onClick={() => setUsingDelegate(!usingDelegate)}>
<TYPE.blue> <TYPE.blue>
{usingDelegate ? 'Remove' : 'Add'} Delegate {!usingDelegate && '+'} {usingDelegate ? (
<Trans id="common.remove">Remove Delegate</Trans>
) : (
<Trans id="common.add">Add Delegate +</Trans>
)}
</TYPE.blue> </TYPE.blue>
</TextButton> </TextButton>
</AutoColumn> </AutoColumn>
...@@ -116,7 +131,13 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro ...@@ -116,7 +131,13 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro
{attempting && !hash && ( {attempting && !hash && (
<LoadingView onDismiss={wrappedOndismiss}> <LoadingView onDismiss={wrappedOndismiss}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>{usingDelegate ? 'Delegating votes' : 'Unlocking Votes'}</TYPE.largeHeader> <TYPE.largeHeader>
{usingDelegate ? (
<Trans id="vote.delegate.delegatingVotes">Delegating votes</Trans>
) : (
<Trans id="vote.delegates.unlockingVotes">Unlocking Votes</Trans>
)}
</TYPE.largeHeader>
<TYPE.main fontSize={36}> {formatTokenAmount(uniBalance, 4)}</TYPE.main> <TYPE.main fontSize={36}> {formatTokenAmount(uniBalance, 4)}</TYPE.main>
</AutoColumn> </AutoColumn>
</LoadingView> </LoadingView>
...@@ -124,7 +145,9 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro ...@@ -124,7 +145,9 @@ export default function DelegateModal({ isOpen, onDismiss, title }: VoteModalPro
{hash && ( {hash && (
<SubmittedView onDismiss={wrappedOndismiss} hash={hash}> <SubmittedView onDismiss={wrappedOndismiss} hash={hash}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader> <TYPE.largeHeader>
<Trans id="transactions.submitted">Transaction Submitted</Trans>
</TYPE.largeHeader>
<TYPE.main fontSize={36}>{formatTokenAmount(uniBalance, 4)}</TYPE.main> <TYPE.main fontSize={36}>{formatTokenAmount(uniBalance, 4)}</TYPE.main>
</AutoColumn> </AutoColumn>
</SubmittedView> </SubmittedView>
......
...@@ -14,6 +14,7 @@ import { useVoteCallback, useUserVotes } from '../../state/governance/hooks' ...@@ -14,6 +14,7 @@ import { useVoteCallback, useUserVotes } from '../../state/governance/hooks'
import { ExternalLink } from '../../theme/components' import { ExternalLink } from '../../theme/components'
import { formatTokenAmount } from 'utils/formatTokenAmount' import { formatTokenAmount } from 'utils/formatTokenAmount'
import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { Trans } from '@lingui/macro'
const ContentWrapper = styled(AutoColumn)` const ContentWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -88,16 +89,26 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo ...@@ -88,16 +89,26 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo
<ContentWrapper gap="lg"> <ContentWrapper gap="lg">
<AutoColumn gap="lg" justify="center"> <AutoColumn gap="lg" justify="center">
<RowBetween> <RowBetween>
<TYPE.mediumHeader fontWeight={500}>{`Vote ${ <TYPE.mediumHeader fontWeight={500}>
support ? 'for ' : 'against' {support ? (
} proposal ${proposalId}`}</TYPE.mediumHeader> <Trans id="vote.support.for">Vote for proposal {proposalId}</Trans>
) : (
<Trans id="vote.support.against">Vote against proposal {proposalId}</Trans>
)}
</TYPE.mediumHeader>
<StyledClosed stroke="black" onClick={wrappedOndismiss} /> <StyledClosed stroke="black" onClick={wrappedOndismiss} />
</RowBetween> </RowBetween>
<TYPE.largeHeader>{formatTokenAmount(availableVotes, 4)} Votes</TYPE.largeHeader> <TYPE.largeHeader>
<Trans id="vote.numVotes">{formatTokenAmount(availableVotes, 4)} Votes</Trans>
</TYPE.largeHeader>
<ButtonPrimary onClick={onVote}> <ButtonPrimary onClick={onVote}>
<TYPE.mediumHeader color="white">{`Vote ${ <TYPE.mediumHeader color="white">
support ? 'for ' : 'against' {support ? (
} proposal ${proposalId}`}</TYPE.mediumHeader> <Trans id="vote.support.for">Vote for proposal {proposalId}</Trans>
) : (
<Trans id="vote.support.against">Vote against proposal {proposalId}</Trans>
)}
</TYPE.mediumHeader>
</ButtonPrimary> </ButtonPrimary>
</AutoColumn> </AutoColumn>
</ContentWrapper> </ContentWrapper>
...@@ -113,9 +124,13 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo ...@@ -113,9 +124,13 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="100px" justify={'center'}> <AutoColumn gap="100px" justify={'center'}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Submitting Vote</TYPE.largeHeader> <TYPE.largeHeader>
<Trans id="vote.submitting">Submitting Vote</Trans>
</TYPE.largeHeader>
</AutoColumn> </AutoColumn>
<TYPE.subHeader>Confirm this transaction in your wallet</TYPE.subHeader> <TYPE.subHeader>
<Trans id="vote.confirmInWallet">Confirm this transaction in your wallet</Trans>
</TYPE.subHeader>
</AutoColumn> </AutoColumn>
</ConfirmOrLoadingWrapper> </ConfirmOrLoadingWrapper>
)} )}
...@@ -130,14 +145,18 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo ...@@ -130,14 +145,18 @@ export default function VoteModal({ isOpen, onDismiss, proposalId, support }: Vo
</ConfirmedIcon> </ConfirmedIcon>
<AutoColumn gap="100px" justify={'center'}> <AutoColumn gap="100px" justify={'center'}>
<AutoColumn gap="12px" justify={'center'}> <AutoColumn gap="12px" justify={'center'}>
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader> <TYPE.largeHeader>
<Trans id="transactions.submitted">Transaction Submitted</Trans>
</TYPE.largeHeader>
</AutoColumn> </AutoColumn>
{chainId && ( {chainId && (
<ExternalLink <ExternalLink
href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}
style={{ marginLeft: '4px' }} style={{ marginLeft: '4px' }}
> >
<TYPE.subHeader>View transaction on Etherscan</TYPE.subHeader> <TYPE.subHeader>
<Trans id="wallet.viewOnEtherscan">View transaction on Etherscan</Trans>
</TYPE.subHeader>
</ExternalLink> </ExternalLink>
)} )}
</AutoColumn> </AutoColumn>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6,6 +6,7 @@ import { RowBetween, RowFixed } from '../../components/Row' ...@@ -6,6 +6,7 @@ import { RowBetween, RowFixed } from '../../components/Row'
import CurrencyLogo from '../../components/CurrencyLogo' import CurrencyLogo from '../../components/CurrencyLogo'
import { Field } from '../../state/mint/actions' import { Field } from '../../state/mint/actions'
import { TYPE } from '../../theme' import { TYPE } from '../../theme'
import { Trans } from '@lingui/macro'
export function ConfirmAddModalBottom({ export function ConfirmAddModalBottom({
noLiquidity, noLiquidity,
...@@ -25,21 +26,27 @@ export function ConfirmAddModalBottom({ ...@@ -25,21 +26,27 @@ export function ConfirmAddModalBottom({
return ( return (
<> <>
<RowBetween> <RowBetween>
<TYPE.body>{currencies[Field.CURRENCY_A]?.symbol} Deposited</TYPE.body> <TYPE.body>
<Trans id="currencies.depositedSymbol">{currencies[Field.CURRENCY_A]?.symbol} Deposited</Trans>
</TYPE.body>
<RowFixed> <RowFixed>
<CurrencyLogo currency={currencies[Field.CURRENCY_A]} style={{ marginRight: '8px' }} /> <CurrencyLogo currency={currencies[Field.CURRENCY_A]} style={{ marginRight: '8px' }} />
<TYPE.body>{parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}</TYPE.body> <TYPE.body>{parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}</TYPE.body>
</RowFixed> </RowFixed>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.body>{currencies[Field.CURRENCY_B]?.symbol} Deposited</TYPE.body> <TYPE.body>
<Trans id="currencies.depositedSymbol">{currencies[Field.CURRENCY_B]?.symbol} Deposited</Trans>
</TYPE.body>
<RowFixed> <RowFixed>
<CurrencyLogo currency={currencies[Field.CURRENCY_B]} style={{ marginRight: '8px' }} /> <CurrencyLogo currency={currencies[Field.CURRENCY_B]} style={{ marginRight: '8px' }} />
<TYPE.body>{parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}</TYPE.body> <TYPE.body>{parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}</TYPE.body>
</RowFixed> </RowFixed>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.body>Rates</TYPE.body> <TYPE.body>
<Trans id="currencies.rates">Rates</Trans>
</TYPE.body>
<TYPE.body> <TYPE.body>
{`1 ${currencies[Field.CURRENCY_A]?.symbol} = ${price?.toSignificant(4)} ${ {`1 ${currencies[Field.CURRENCY_A]?.symbol} = ${price?.toSignificant(4)} ${
currencies[Field.CURRENCY_B]?.symbol currencies[Field.CURRENCY_B]?.symbol
...@@ -54,12 +61,20 @@ export function ConfirmAddModalBottom({ ...@@ -54,12 +61,20 @@ export function ConfirmAddModalBottom({
</TYPE.body> </TYPE.body>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.body>Share of Pool:</TYPE.body> <TYPE.body>
<TYPE.body>{noLiquidity ? '100' : poolTokenPercentage?.toSignificant(4)}%</TYPE.body> <Trans id="pool.shareOfPool">Share of Pool:</Trans>
</TYPE.body>
<TYPE.body>
<Trans id="number.valueWithPercent">{noLiquidity ? '100' : poolTokenPercentage?.toSignificant(4)}%</Trans>
</TYPE.body>
</RowBetween> </RowBetween>
<ButtonPrimary style={{ margin: '20px 0 0 0' }} onClick={onAdd}> <ButtonPrimary style={{ margin: '20px 0 0 0' }} onClick={onAdd}>
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
{noLiquidity ? 'Create Pool & Supply' : 'Confirm Supply'} {noLiquidity ? (
<Trans id="pool.createPoolAndSupply">Create Pool & Supply</Trans>
) : (
<Trans id="pool.confirmSupply">Confirm Supply</Trans>
)}
</Text> </Text>
</ButtonPrimary> </ButtonPrimary>
</> </>
......
...@@ -41,6 +41,7 @@ import { ConfirmAddModalBottom } from './ConfirmAddModalBottom' ...@@ -41,6 +41,7 @@ import { ConfirmAddModalBottom } from './ConfirmAddModalBottom'
import { currencyId } from '../../utils/currencyId' import { currencyId } from '../../utils/currencyId'
import { PoolPriceBar } from './PoolPriceBar' import { PoolPriceBar } from './PoolPriceBar'
import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter'
import { t, Trans } from '@lingui/macro'
const DEFAULT_ADD_V2_SLIPPAGE_TOLERANCE = new Percent(50, 10_000) const DEFAULT_ADD_V2_SLIPPAGE_TOLERANCE = new Percent(50, 10_000)
...@@ -184,15 +185,12 @@ export default function AddLiquidity({ ...@@ -184,15 +185,12 @@ export default function AddLiquidity({
setAttemptingTxn(false) setAttemptingTxn(false)
addTransaction(response, { addTransaction(response, {
summary: summary: t({
'Add ' + id: 'transactions.summary.addLiquidityWithValue',
parsedAmounts[Field.CURRENCY_A]?.toSignificant(3) + message: `Add ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(3)} ${
' ' + currencies[Field.CURRENCY_A]?.symbol
currencies[Field.CURRENCY_A]?.symbol + } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(3)} ${currencies[Field.CURRENCY_B]?.symbol}`,
' and ' + }),
parsedAmounts[Field.CURRENCY_B]?.toSignificant(3) +
' ' +
currencies[Field.CURRENCY_B]?.symbol,
}) })
setTxHash(response.hash) setTxHash(response.hash)
...@@ -247,9 +245,10 @@ export default function AddLiquidity({ ...@@ -247,9 +245,10 @@ export default function AddLiquidity({
</Text> </Text>
</Row> </Row>
<TYPE.italic fontSize={12} textAlign="left" padding={'8px 0 0 0 '}> <TYPE.italic fontSize={12} textAlign="left" padding={'8px 0 0 0 '}>
{`Output is estimated. If the price changes by more than ${allowedSlippage.toSignificant( <Trans id="swap.outputEstimatedHint">
4 Output is estimated. If the price changes by more than {allowedSlippage.toSignificant(4)}% your transaction
)}% your transaction will revert.`} will revert.
</Trans>
</TYPE.italic> </TYPE.italic>
</AutoColumn> </AutoColumn>
) )
...@@ -268,9 +267,12 @@ export default function AddLiquidity({ ...@@ -268,9 +267,12 @@ export default function AddLiquidity({
) )
} }
const pendingText = `Supplying ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${ const pendingText = t({
currencies[Field.CURRENCY_A]?.symbol id: 'addLiquidity.confirmation.pendingV2',
} and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencies[Field.CURRENCY_B]?.symbol}` message: `Supplying ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${
currencies[Field.CURRENCY_A]?.symbol
} and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencies[Field.CURRENCY_B]?.symbol}`,
})
const handleCurrencyASelect = useCallback( const handleCurrencyASelect = useCallback(
(currencyA: Currency) => { (currencyA: Currency) => {
...@@ -324,7 +326,11 @@ export default function AddLiquidity({ ...@@ -324,7 +326,11 @@ export default function AddLiquidity({
hash={txHash} hash={txHash}
content={() => ( content={() => (
<ConfirmationModalContent <ConfirmationModalContent
title={noLiquidity ? 'You are creating a pool' : 'You will receive'} title={
noLiquidity
? t({ id: 'pool.creatingPool', message: 'You are creating a pool' })
: t({ id: 'pool.yourWillReceive', message: 'You will receive' })
}
onDismiss={handleDismissConfirmation} onDismiss={handleDismissConfirmation}
topContent={modalHeader} topContent={modalHeader}
bottomContent={modalBottom} bottomContent={modalBottom}
...@@ -340,13 +346,15 @@ export default function AddLiquidity({ ...@@ -340,13 +346,15 @@ export default function AddLiquidity({
<BlueCard> <BlueCard>
<AutoColumn gap="10px"> <AutoColumn gap="10px">
<TYPE.link fontWeight={600} color={'primaryText1'}> <TYPE.link fontWeight={600} color={'primaryText1'}>
You are the first liquidity provider. <Trans id="pool.firstLiquidityProvider">You are the first liquidity provider.</Trans>
</TYPE.link> </TYPE.link>
<TYPE.link fontWeight={400} color={'primaryText1'}> <TYPE.link fontWeight={400} color={'primaryText1'}>
The ratio of tokens you add will set the price of this pool. <Trans id="pool.initialPriceHint">
The ratio of tokens you add will set the price of this pool.
</Trans>
</TYPE.link> </TYPE.link>
<TYPE.link fontWeight={400} color={'primaryText1'}> <TYPE.link fontWeight={400} color={'primaryText1'}>
Once you are happy with the rate click supply to review. <Trans id="pool.reviewHint">Once you are happy with the rate click supply to review.</Trans>
</TYPE.link> </TYPE.link>
</AutoColumn> </AutoColumn>
</BlueCard> </BlueCard>
...@@ -356,9 +364,14 @@ export default function AddLiquidity({ ...@@ -356,9 +364,14 @@ export default function AddLiquidity({
<BlueCard> <BlueCard>
<AutoColumn gap="10px"> <AutoColumn gap="10px">
<TYPE.link fontWeight={400} color={'primaryText1'}> <TYPE.link fontWeight={400} color={'primaryText1'}>
<b>Tip:</b> When you add liquidity, you will receive pool tokens representing your position. <Trans id="pool.addLiquidityLPHint">
These tokens automatically earn fees proportional to your share of the pool, and can be redeemed <b>
at any time. <Trans id="">Tip:</Trans>
</b>{' '}
When you add liquidity, you will receive pool tokens representing your position. These tokens
automatically earn fees proportional to your share of the pool, and can be redeemed at any
time.
</Trans>
</TYPE.link> </TYPE.link>
</AutoColumn> </AutoColumn>
</BlueCard> </BlueCard>
...@@ -396,7 +409,11 @@ export default function AddLiquidity({ ...@@ -396,7 +409,11 @@ export default function AddLiquidity({
<LightCard padding="0px" borderRadius={'20px'}> <LightCard padding="0px" borderRadius={'20px'}>
<RowBetween padding="1rem"> <RowBetween padding="1rem">
<TYPE.subHeader fontWeight={500} fontSize={14}> <TYPE.subHeader fontWeight={500} fontSize={14}>
{noLiquidity ? 'Initial prices' : 'Prices'} and pool share {noLiquidity ? (
<Trans id="pool.prices.noLiquidity">Initial prices and pool share</Trans>
) : (
<Trans id="pool.prices.withLiquidity">Prices and pool share</Trans>
)}
</TYPE.subHeader> </TYPE.subHeader>
</RowBetween>{' '} </RowBetween>{' '}
<LightCard padding="1rem" borderRadius={'20px'}> <LightCard padding="1rem" borderRadius={'20px'}>
...@@ -413,10 +430,14 @@ export default function AddLiquidity({ ...@@ -413,10 +430,14 @@ export default function AddLiquidity({
{addIsUnsupported ? ( {addIsUnsupported ? (
<ButtonPrimary disabled={true}> <ButtonPrimary disabled={true}>
<TYPE.main mb="4px">Unsupported Asset</TYPE.main> <TYPE.main mb="4px">
<Trans id="error.unsupportedAsset">Unsupported Asset</Trans>
</TYPE.main>
</ButtonPrimary> </ButtonPrimary>
) : !account ? ( ) : !account ? (
<ButtonLight onClick={toggleWalletModal}>Connect Wallet</ButtonLight> <ButtonLight onClick={toggleWalletModal}>
<Trans id="wallet.connect">Connect Wallet</Trans>
</ButtonLight>
) : ( ) : (
<AutoColumn gap={'md'}> <AutoColumn gap={'md'}>
{(approvalA === ApprovalState.NOT_APPROVED || {(approvalA === ApprovalState.NOT_APPROVED ||
...@@ -432,9 +453,15 @@ export default function AddLiquidity({ ...@@ -432,9 +453,15 @@ export default function AddLiquidity({
width={approvalB !== ApprovalState.APPROVED ? '48%' : '100%'} width={approvalB !== ApprovalState.APPROVED ? '48%' : '100%'}
> >
{approvalA === ApprovalState.PENDING ? ( {approvalA === ApprovalState.PENDING ? (
<Dots>Approving {currencies[Field.CURRENCY_A]?.symbol}</Dots> <Dots>
<Trans id="transactions.approvingCurrency">
Approving {currencies[Field.CURRENCY_A]?.symbol}
</Trans>
</Dots>
) : ( ) : (
'Approve ' + currencies[Field.CURRENCY_A]?.symbol <Trans id="transaction.approveCurrency">
Approve {currencies[Field.CURRENCY_A]?.symbol}
</Trans>
)} )}
</ButtonPrimary> </ButtonPrimary>
)} )}
...@@ -445,9 +472,15 @@ export default function AddLiquidity({ ...@@ -445,9 +472,15 @@ export default function AddLiquidity({
width={approvalA !== ApprovalState.APPROVED ? '48%' : '100%'} width={approvalA !== ApprovalState.APPROVED ? '48%' : '100%'}
> >
{approvalB === ApprovalState.PENDING ? ( {approvalB === ApprovalState.PENDING ? (
<Dots>Approving {currencies[Field.CURRENCY_B]?.symbol}</Dots> <Dots>
<Trans id="transactions.approvingCurrency">
Approving {currencies[Field.CURRENCY_B]?.symbol}
</Trans>
</Dots>
) : ( ) : (
'Approve ' + currencies[Field.CURRENCY_B]?.symbol <Trans id="transaction.approveCurrency">
Approve {currencies[Field.CURRENCY_B]?.symbol}
</Trans>
)} )}
</ButtonPrimary> </ButtonPrimary>
)} )}
...@@ -461,7 +494,7 @@ export default function AddLiquidity({ ...@@ -461,7 +494,7 @@ export default function AddLiquidity({
error={!isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]} error={!isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]}
> >
<Text fontSize={20} fontWeight={500}> <Text fontSize={20} fontWeight={500}>
{error ?? 'Supply'} {error ?? <Trans id="pool.buttons.supply">Supply</Trans>}
</Text> </Text>
</ButtonError> </ButtonError>
</AutoColumn> </AutoColumn>
......
...@@ -28,6 +28,7 @@ import { useV2Pair } from '../../hooks/useV2Pairs' ...@@ -28,6 +28,7 @@ import { useV2Pair } from '../../hooks/useV2Pairs'
import usePrevious from '../../hooks/usePrevious' import usePrevious from '../../hooks/usePrevious'
import useUSDCPrice from '../../hooks/useUSDCPrice' import useUSDCPrice from '../../hooks/useUSDCPrice'
import { BIG_INT_ZERO, BIG_INT_SECONDS_IN_WEEK } from '../../constants/misc' import { BIG_INT_ZERO, BIG_INT_SECONDS_IN_WEEK } from '../../constants/misc'
import { Trans } from '@lingui/macro'
const PageWrapper = styled(AutoColumn)` const PageWrapper = styled(AutoColumn)`
max-width: 640px; max-width: 640px;
...@@ -156,7 +157,9 @@ export default function Manage({ ...@@ -156,7 +157,9 @@ export default function Manage({
<PageWrapper gap="lg" justify="center"> <PageWrapper gap="lg" justify="center">
<RowBetween style={{ gap: '24px' }}> <RowBetween style={{ gap: '24px' }}>
<TYPE.mediumHeader style={{ margin: 0 }}> <TYPE.mediumHeader style={{ margin: 0 }}>
{currencyA?.symbol}-{currencyB?.symbol} Liquidity Mining <Trans id="earn.pool.liquidityMining">
{currencyA?.symbol}-{currencyB?.symbol} Liquidity Mining
</Trans>
</TYPE.mediumHeader> </TYPE.mediumHeader>
<DoubleCurrencyLogo currency0={currencyA ?? undefined} currency1={currencyB ?? undefined} size={24} /> <DoubleCurrencyLogo currency0={currencyA ?? undefined} currency1={currencyB ?? undefined} size={24} />
</RowBetween> </RowBetween>
...@@ -164,7 +167,9 @@ export default function Manage({ ...@@ -164,7 +167,9 @@ export default function Manage({
<DataRow style={{ gap: '24px' }}> <DataRow style={{ gap: '24px' }}>
<PoolData> <PoolData>
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<TYPE.body style={{ margin: 0 }}>Total deposits</TYPE.body> <TYPE.body style={{ margin: 0 }}>
<Trans id="earn.pool.totalDeposits">Total deposits</Trans>
</TYPE.body>
<TYPE.body fontSize={24} fontWeight={500}> <TYPE.body fontSize={24} fontWeight={500}>
{valueOfTotalStakedAmountInUSDC {valueOfTotalStakedAmountInUSDC
? `$${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}` ? `$${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}`
...@@ -174,14 +179,18 @@ export default function Manage({ ...@@ -174,14 +179,18 @@ export default function Manage({
</PoolData> </PoolData>
<PoolData> <PoolData>
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<TYPE.body style={{ margin: 0 }}>Pool Rate</TYPE.body> <TYPE.body style={{ margin: 0 }}>
<Trans id="earn.pool.rate">Pool Rate</Trans>
</TYPE.body>
<TYPE.body fontSize={24} fontWeight={500}> <TYPE.body fontSize={24} fontWeight={500}>
{stakingInfo?.active {stakingInfo.active ? (
? stakingInfo?.totalRewardRate <Trans id="earn.pool.rewardRate">
?.multiply(BIG_INT_SECONDS_IN_WEEK) {stakingInfo.totalRewardRate?.multiply(BIG_INT_SECONDS_IN_WEEK)?.toFixed(0, { groupSeparator: ',' })}{' '}
?.toFixed(0, { groupSeparator: ',' }) ?? '-' UNI / week
: '0'} </Trans>
{' UNI / week'} ) : (
<Trans id="earn.pool.noRewardRate">0 UNI / week</Trans>
)}
</TYPE.body> </TYPE.body>
</AutoColumn> </AutoColumn>
</PoolData> </PoolData>
...@@ -194,11 +203,16 @@ export default function Manage({ ...@@ -194,11 +203,16 @@ export default function Manage({
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={600}>Step 1. Get UNI-V2 Liquidity tokens</TYPE.white> <TYPE.white fontWeight={600}>
<Trans id="earn.instructions1.title">Step 1. Get UNI-V2 Liquidity tokens</Trans>
</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween style={{ marginBottom: '1rem' }}> <RowBetween style={{ marginBottom: '1rem' }}>
<TYPE.white fontSize={14}> <TYPE.white fontSize={14}>
{`UNI-V2 LP tokens are required. Once you've added liquidity to the ${currencyA?.symbol}-${currencyB?.symbol} pool you can stake your liquidity tokens on this page.`} <Trans id="earn.instructions1.hint">
UNI-V2 LP tokens are required. Once you&apos;ve added liquidity to the {currencyA?.symbol}-
{currencyB?.symbol} pool you can stake your liquidity tokens on this page.
</Trans>
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
<ButtonPrimary <ButtonPrimary
...@@ -208,7 +222,9 @@ export default function Manage({ ...@@ -208,7 +222,9 @@ export default function Manage({
as={Link} as={Link}
to={`/add/${currencyA && currencyId(currencyA)}/${currencyB && currencyId(currencyB)}`} to={`/add/${currencyA && currencyId(currencyA)}/${currencyB && currencyId(currencyB)}`}
> >
{`Add ${currencyA?.symbol}-${currencyB?.symbol} liquidity`} <Trans id="earn.pool.addLiquidity">
Add {currencyA?.symbol}-{currencyB?.symbol} liquidity
</Trans>
</ButtonPrimary> </ButtonPrimary>
</AutoColumn> </AutoColumn>
</CardSection> </CardSection>
...@@ -246,14 +262,18 @@ export default function Manage({ ...@@ -246,14 +262,18 @@ export default function Manage({
<CardNoise /> <CardNoise />
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={600}>Your liquidity deposits</TYPE.white> <TYPE.white fontWeight={600}>
<Trans id="earn.pool.liquidityDeposited">Your liquidity deposits</Trans>
</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween style={{ alignItems: 'baseline' }}> <RowBetween style={{ alignItems: 'baseline' }}>
<TYPE.white fontSize={36} fontWeight={600}> <TYPE.white fontSize={36} fontWeight={600}>
{stakingInfo?.stakedAmount?.toSignificant(6) ?? '-'} {stakingInfo?.stakedAmount?.toSignificant(6) ?? '-'}
</TYPE.white> </TYPE.white>
<TYPE.white> <TYPE.white>
UNI-V2 {currencyA?.symbol}-{currencyB?.symbol} <Trans id="earn.claim.UNIV2">
UNI-V2 {currencyA?.symbol}-{currencyB?.symbol}
</Trans>
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
</AutoColumn> </AutoColumn>
...@@ -265,7 +285,9 @@ export default function Manage({ ...@@ -265,7 +285,9 @@ export default function Manage({
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<RowBetween> <RowBetween>
<div> <div>
<TYPE.black>Your unclaimed UNI</TYPE.black> <TYPE.black>
<Trans id="earn.claim.unclaimedUNI">Your unclaimed UNI</Trans>
</TYPE.black>
</div> </div>
{stakingInfo?.earnedAmount && JSBI.notEqual(BIG_INT_ZERO, stakingInfo?.earnedAmount?.quotient) && ( {stakingInfo?.earnedAmount && JSBI.notEqual(BIG_INT_ZERO, stakingInfo?.earnedAmount?.quotient) && (
<ButtonEmpty <ButtonEmpty
...@@ -274,7 +296,7 @@ export default function Manage({ ...@@ -274,7 +296,7 @@ export default function Manage({
width="fit-content" width="fit-content"
onClick={() => setShowClaimRewardModal(true)} onClick={() => setShowClaimRewardModal(true)}
> >
Claim <Trans id="earn.claim.label">Claim</Trans>
</ButtonEmpty> </ButtonEmpty>
)} )}
</RowBetween> </RowBetween>
...@@ -294,12 +316,15 @@ export default function Manage({ ...@@ -294,12 +316,15 @@ export default function Manage({
<span role="img" aria-label="wizard-icon" style={{ marginRight: '8px ' }}> <span role="img" aria-label="wizard-icon" style={{ marginRight: '8px ' }}>
</span> </span>
{stakingInfo?.active
? stakingInfo?.rewardRate {stakingInfo.active ? (
?.multiply(BIG_INT_SECONDS_IN_WEEK) <Trans id="earn.pool.rewardRate">
?.toSignificant(4, { groupSeparator: ',' }) ?? '-' {stakingInfo.rewardRate?.multiply(BIG_INT_SECONDS_IN_WEEK)?.toFixed(0, { groupSeparator: ',' })}{' '}
: '0'} UNI / week
{' UNI / week'} </Trans>
) : (
<Trans id="earn.pool.noRewardRate">0 UNI / week</Trans>
)}
</TYPE.black> </TYPE.black>
</RowBetween> </RowBetween>
</AutoColumn> </AutoColumn>
...@@ -309,14 +334,20 @@ export default function Manage({ ...@@ -309,14 +334,20 @@ export default function Manage({
<span role="img" aria-label="wizard-icon" style={{ marginRight: '8px' }}> <span role="img" aria-label="wizard-icon" style={{ marginRight: '8px' }}>
⭐️ ⭐️
</span> </span>
When you withdraw, the contract will automagically claim UNI on your behalf! <Trans id="earn.claim.withdrawingClaimsUNI">
When you withdraw, the contract will automagically claim UNI on your behalf!
</Trans>
</TYPE.main> </TYPE.main>
{!showAddLiquidityButton && ( {!showAddLiquidityButton && (
<DataRow style={{ marginBottom: '1rem' }}> <DataRow style={{ marginBottom: '1rem' }}>
{stakingInfo && stakingInfo.active && ( {stakingInfo && stakingInfo.active && (
<ButtonPrimary padding="8px" borderRadius="8px" width="160px" onClick={handleDepositClick}> <ButtonPrimary padding="8px" borderRadius="8px" width="160px" onClick={handleDepositClick}>
{stakingInfo?.stakedAmount?.greaterThan(JSBI.BigInt(0)) ? 'Deposit' : 'Deposit UNI-V2 LP Tokens'} {stakingInfo?.stakedAmount?.greaterThan(JSBI.BigInt(0)) ? (
<Trans id="common.deposit">Deposit</Trans>
) : (
<Trans id="earn.depositUNIVLP">Deposit UNI-V2 LP Tokens</Trans>
)}
</ButtonPrimary> </ButtonPrimary>
)} )}
...@@ -328,14 +359,18 @@ export default function Manage({ ...@@ -328,14 +359,18 @@ export default function Manage({
width="160px" width="160px"
onClick={() => setShowUnstakingModal(true)} onClick={() => setShowUnstakingModal(true)}
> >
Withdraw <Trans id="common.withdraw">Withdraw</Trans>
</ButtonPrimary> </ButtonPrimary>
</> </>
)} )}
</DataRow> </DataRow>
)} )}
{!userLiquidityUnstaked ? null : userLiquidityUnstaked.equalTo('0') ? null : !stakingInfo?.active ? null : ( {!userLiquidityUnstaked ? null : userLiquidityUnstaked.equalTo('0') ? null : !stakingInfo?.active ? null : (
<TYPE.main>{userLiquidityUnstaked.toSignificant(6)} UNI-V2 LP tokens available</TYPE.main> <TYPE.main>
<Trans id="earn.claim.UNIV2LPAvailable">
{userLiquidityUnstaked.toSignificant(6)} UNI-V2 LP tokens available
</Trans>
</TYPE.main>
)} )}
</PositionInfo> </PositionInfo>
</PageWrapper> </PageWrapper>
......
...@@ -12,6 +12,7 @@ import Loader from '../../components/Loader' ...@@ -12,6 +12,7 @@ import Loader from '../../components/Loader'
import { useActiveWeb3React } from '../../hooks/web3' import { useActiveWeb3React } from '../../hooks/web3'
import { BIG_INT_ZERO } from '../../constants/misc' import { BIG_INT_ZERO } from '../../constants/misc'
import { OutlineCard } from '../../components/Card' import { OutlineCard } from '../../components/Card'
import { Trans } from '@lingui/macro'
const PageWrapper = styled(AutoColumn)` const PageWrapper = styled(AutoColumn)`
max-width: 640px; max-width: 640px;
...@@ -62,11 +63,15 @@ export default function Earn() { ...@@ -62,11 +63,15 @@ export default function Earn() {
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={600}>Uniswap liquidity mining</TYPE.white> <TYPE.white fontWeight={600}>
<Trans id="earn.liquidityMining">Uniswap liquidity mining</Trans>
</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white fontSize={14}> <TYPE.white fontSize={14}>
Deposit your Liquidity Provider tokens to receive UNI, the Uniswap protocol governance token. <Trans id="earn.depositLPHint">
Deposit your Liquidity Provider tokens to receive UNI, the Uniswap protocol governance token.
</Trans>
</TYPE.white> </TYPE.white>
</RowBetween>{' '} </RowBetween>{' '}
<ExternalLink <ExternalLink
...@@ -74,7 +79,9 @@ export default function Earn() { ...@@ -74,7 +79,9 @@ export default function Earn() {
href="https://uniswap.org/blog/uni/" href="https://uniswap.org/blog/uni/"
target="_blank" target="_blank"
> >
<TYPE.white fontSize={14}>Read more about UNI</TYPE.white> <TYPE.white fontSize={14}>
<Trans id="uni.readMore">Read more about UNI</Trans>
</TYPE.white>
</ExternalLink> </ExternalLink>
</AutoColumn> </AutoColumn>
</CardSection> </CardSection>
...@@ -85,7 +92,9 @@ export default function Earn() { ...@@ -85,7 +92,9 @@ export default function Earn() {
<AutoColumn gap="lg" style={{ width: '100%', maxWidth: '720px' }}> <AutoColumn gap="lg" style={{ width: '100%', maxWidth: '720px' }}>
<DataRow style={{ alignItems: 'baseline' }}> <DataRow style={{ alignItems: 'baseline' }}>
<TYPE.mediumHeader style={{ marginTop: '0.5rem' }}>Participating pools</TYPE.mediumHeader> <TYPE.mediumHeader style={{ marginTop: '0.5rem' }}>
<Trans id="earn.participatingPools">Participating pools</Trans>
</TYPE.mediumHeader>
<Countdown exactEnd={stakingInfos?.[0]?.periodFinish} /> <Countdown exactEnd={stakingInfos?.[0]?.periodFinish} />
</DataRow> </DataRow>
...@@ -93,9 +102,13 @@ export default function Earn() { ...@@ -93,9 +102,13 @@ export default function Earn() {
{stakingRewardsExist && stakingInfos?.length === 0 ? ( {stakingRewardsExist && stakingInfos?.length === 0 ? (
<Loader style={{ margin: 'auto' }} /> <Loader style={{ margin: 'auto' }} />
) : !stakingRewardsExist ? ( ) : !stakingRewardsExist ? (
<OutlineCard>No active pools</OutlineCard> <OutlineCard>
<Trans id="earn.noActivePools">No active pools</Trans>
</OutlineCard>
) : stakingInfos?.length !== 0 && stakingInfosWithBalance.length === 0 ? ( ) : stakingInfos?.length !== 0 && stakingInfosWithBalance.length === 0 ? (
<OutlineCard>No active pools</OutlineCard> <OutlineCard>
<Trans id="earn.noActivePools">No active pools</Trans>
</OutlineCard>
) : ( ) : (
stakingInfosWithBalance?.map((stakingInfo) => { stakingInfosWithBalance?.map((stakingInfo) => {
// need to sort by added liquidity here // need to sort by added liquidity here
......
...@@ -18,6 +18,7 @@ import MigrateSushiPositionCard from 'components/PositionCard/Sushi' ...@@ -18,6 +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'
function EmptyState({ message }: { message: string }) { function EmptyState({ message }: { message: string }) {
return ( return (
...@@ -110,27 +111,40 @@ export default function MigrateV2() { ...@@ -110,27 +111,40 @@ export default function MigrateV2() {
<AutoColumn gap="16px"> <AutoColumn gap="16px">
<AutoRow style={{ alignItems: 'center', justifyContent: 'space-between' }} gap="8px"> <AutoRow style={{ alignItems: 'center', justifyContent: 'space-between' }} gap="8px">
<BackArrow to="/pool" /> <BackArrow to="/pool" />
<TYPE.mediumHeader>Migrate V2 Liquidity</TYPE.mediumHeader> <TYPE.mediumHeader>
<Trans id="migrate.buttons.migrateV2Liquidity">Migrate V2 Liquidity</Trans>
</TYPE.mediumHeader>
<div> <div>
<QuestionHelper text="Migrate your liquidity tokens from Uniswap V2 to Uniswap V3." /> <QuestionHelper
text={t({
id: 'migrate.hint.migrateFromV2ToV3',
message: 'Migrate your liquidity tokens from Uniswap V2 to Uniswap V3.',
})}
/>
</div> </div>
</AutoRow> </AutoRow>
<TYPE.body style={{ marginBottom: 8, fontWeight: 400 }}> <TYPE.body style={{ marginBottom: 8, fontWeight: 400 }}>
For each pool shown below, click migrate to remove your liquidity from Uniswap V2 and deposit it into Uniswap <Trans id="migrate.hint.clickToRemoveV2">
V3. For each pool shown below, click migrate to remove your liquidity from Uniswap V2 and deposit it into
Uniswap V3.
</Trans>
</TYPE.body> </TYPE.body>
{!account ? ( {!account ? (
<LightCard padding="40px"> <LightCard padding="40px">
<TYPE.body color={theme.text3} textAlign="center"> <TYPE.body color={theme.text3} textAlign="center">
Connect to a wallet to view your V2 liquidity. <Trans id="migrate.hint.connectWalltToViewV2Liquidity">
Connect to a wallet to view your V2 liquidity.
</Trans>
</TYPE.body> </TYPE.body>
</LightCard> </LightCard>
) : v2IsLoading ? ( ) : v2IsLoading ? (
<LightCard padding="40px"> <LightCard padding="40px">
<TYPE.body color={theme.text3} textAlign="center"> <TYPE.body color={theme.text3} textAlign="center">
<Dots>Loading</Dots> <Dots>
<Trans id="common.loading">Loading</Trans>
</Dots>
</TYPE.body> </TYPE.body>
</LightCard> </LightCard>
) : v2Pairs.filter(([, pair]) => !!pair).length > 0 ? ( ) : v2Pairs.filter(([, pair]) => !!pair).length > 0 ? (
...@@ -158,10 +172,12 @@ export default function MigrateV2() { ...@@ -158,10 +172,12 @@ export default function MigrateV2() {
<AutoColumn justify={'center'} gap="md"> <AutoColumn justify={'center'} gap="md">
<Text textAlign="center" fontSize={14} style={{ padding: '.5rem 0 .5rem 0' }}> <Text textAlign="center" fontSize={14} style={{ padding: '.5rem 0 .5rem 0' }}>
{'Don’t see one of your v2 positions?'}{' '} <Trans id="migrate.hint.importV2Position">
<StyledInternalLink id="import-pool-link" to={'/find?origin=/migrate/v2'}> Don’t see one of your v2 positions?{' '}
{'Import it.'} <StyledInternalLink id="import-pool-link" to={'/find?origin=/migrate/v2'}>
</StyledInternalLink> Import it.
</StyledInternalLink>
</Trans>
</Text> </Text>
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
......
...@@ -22,6 +22,7 @@ import { CardSection, DataCard, CardNoise, CardBGImage } from '../../components/ ...@@ -22,6 +22,7 @@ import { CardSection, DataCard, CardNoise, CardBGImage } from '../../components/
import { useStakingInfo } from '../../state/stake/hooks' import { useStakingInfo } from '../../state/stake/hooks'
import { BIG_INT_ZERO } from '../../constants/misc' import { BIG_INT_ZERO } from '../../constants/misc'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
import { Trans } from '@lingui/macro'
const PageWrapper = styled(AutoColumn)` const PageWrapper = styled(AutoColumn)`
max-width: 640px; max-width: 640px;
...@@ -135,11 +136,16 @@ export default function Pool() { ...@@ -135,11 +136,16 @@ export default function Pool() {
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={600}>Liquidity provider rewards</TYPE.white> <TYPE.white fontWeight={600}>
<Trans id="pools.labels.liquidityProviderRewards">Liquidity provider rewards</Trans>
</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white fontSize={14}> <TYPE.white fontSize={14}>
{`Liquidity providers earn a 0.3% fee on all trades proportional to their share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.`} <Trans id="pools.hints.liquidityProviderRewards">
Liquidity providers earn a 0.3% fee on all trades proportional to their share of the pool. Fees are
added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.
</Trans>
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
<ExternalLink <ExternalLink
...@@ -147,7 +153,9 @@ export default function Pool() { ...@@ -147,7 +153,9 @@ export default function Pool() {
target="_blank" target="_blank"
href="https://uniswap.org/docs/v2/core-concepts/pools/" href="https://uniswap.org/docs/v2/core-concepts/pools/"
> >
<TYPE.white fontSize={14}>Read more about providing liquidity</TYPE.white> <TYPE.white fontSize={14}>
<Trans id="pools.hints.readAboutProvidingLiquidity">Read more about providing liquidity</Trans>
</TYPE.white>
</ExternalLink> </ExternalLink>
</AutoColumn> </AutoColumn>
</CardSection> </CardSection>
...@@ -160,12 +168,12 @@ export default function Pool() { ...@@ -160,12 +168,12 @@ export default function Pool() {
<TitleRow style={{ marginTop: '1rem' }} padding={'0'}> <TitleRow style={{ marginTop: '1rem' }} padding={'0'}>
<HideSmall> <HideSmall>
<TYPE.mediumHeader style={{ marginTop: '0.5rem', justifySelf: 'flex-start' }}> <TYPE.mediumHeader style={{ marginTop: '0.5rem', justifySelf: 'flex-start' }}>
Your V2 liquidity <Trans id="pools.labels.yourV2Liquidity">Your V2 liquidity</Trans>
</TYPE.mediumHeader> </TYPE.mediumHeader>
</HideSmall> </HideSmall>
<ButtonRow> <ButtonRow>
<ResponsiveButtonSecondary as={Link} padding="6px 8px" to="/add/v2/ETH"> <ResponsiveButtonSecondary as={Link} padding="6px 8px" to="/add/v2/ETH">
Create a pair <Trans id="pools.buttons.createPair">Create a pair</Trans>
</ResponsiveButtonSecondary> </ResponsiveButtonSecondary>
<ResponsiveButtonPrimary <ResponsiveButtonPrimary
id="join-pool-button" id="join-pool-button"
...@@ -175,7 +183,7 @@ export default function Pool() { ...@@ -175,7 +183,7 @@ export default function Pool() {
to="/add/v2/ETH" to="/add/v2/ETH"
> >
<Text fontWeight={500} fontSize={16}> <Text fontWeight={500} fontSize={16}>
Add V2 Liquidity <Trans id="pools.buttons.addV2Liquidity">Add V2 Liquidity</Trans>
</Text> </Text>
</ResponsiveButtonPrimary> </ResponsiveButtonPrimary>
</ButtonRow> </ButtonRow>
...@@ -184,23 +192,27 @@ export default function Pool() { ...@@ -184,23 +192,27 @@ export default function Pool() {
{!account ? ( {!account ? (
<Card padding="40px"> <Card padding="40px">
<TYPE.body color={theme.text3} textAlign="center"> <TYPE.body color={theme.text3} textAlign="center">
Connect to a wallet to view your liquidity. <Trans id="wallet.connectWalletToViewLiquidity">Connect to a wallet to view your liquidity.</Trans>
</TYPE.body> </TYPE.body>
</Card> </Card>
) : v2IsLoading ? ( ) : v2IsLoading ? (
<EmptyProposals> <EmptyProposals>
<TYPE.body color={theme.text3} textAlign="center"> <TYPE.body color={theme.text3} textAlign="center">
<Dots>Loading</Dots> <Dots>
<Trans id="common.loading">Loading</Trans>
</Dots>
</TYPE.body> </TYPE.body>
</EmptyProposals> </EmptyProposals>
) : allV2PairsWithLiquidity?.length > 0 || stakingPairs?.length > 0 ? ( ) : allV2PairsWithLiquidity?.length > 0 || stakingPairs?.length > 0 ? (
<> <>
<ButtonSecondary> <ButtonSecondary>
<RowBetween> <RowBetween>
<ExternalLink href={'https://v2.info.uniswap.org/account/' + account}> <Trans id="pools.buttons.accountAnalytics">
Account analytics and accrued fees <ExternalLink href={'https://v2.info.uniswap.org/account/' + account}>
</ExternalLink> Account analytics and accrued fees
<span></span> </ExternalLink>
<span></span>
</Trans>
</RowBetween> </RowBetween>
</ButtonSecondary> </ButtonSecondary>
{v2PairsWithoutStakedAmount.map((v2Pair) => ( {v2PairsWithoutStakedAmount.map((v2Pair) => (
...@@ -230,14 +242,14 @@ export default function Pool() { ...@@ -230,14 +242,14 @@ export default function Pool() {
}} }}
> >
<ChevronsRight size={16} style={{ marginRight: '8px' }} /> <ChevronsRight size={16} style={{ marginRight: '8px' }} />
Migrate Liquidity to V3 <Trans id="pools.buttons.migrateLiquidityToV3">Migrate Liquidity to V3</Trans>
</ButtonOutlined> </ButtonOutlined>
</RowFixed> </RowFixed>
</> </>
) : ( ) : (
<EmptyProposals> <EmptyProposals>
<TYPE.body color={theme.text3} textAlign="center"> <TYPE.body color={theme.text3} textAlign="center">
No liquidity found. <Trans id="pools.labels.noLiquidityFound">No liquidity found.</Trans>
</TYPE.body> </TYPE.body>
</EmptyProposals> </EmptyProposals>
)} )}
......
...@@ -478,7 +478,9 @@ export default function Swap({ history }: RouteComponentProps) { ...@@ -478,7 +478,9 @@ export default function Swap({ history }: RouteComponentProps) {
marginLeft: '0.25rem', marginLeft: '0.25rem',
}} }}
> >
<TYPE.black fontSize={12}>V3</TYPE.black> <TYPE.black fontSize={12}>
<Trans id="swap.buttons.v3">V3</Trans>
</TYPE.black>
</ButtonGray> </ButtonGray>
)} )}
</RowFixed> </RowFixed>
......
...@@ -38,6 +38,7 @@ import { ExternalLink, StyledInternalLink, TYPE } from '../../theme' ...@@ -38,6 +38,7 @@ import { ExternalLink, StyledInternalLink, TYPE } from '../../theme'
import { isAddress } from '../../utils' import { isAddress } from '../../utils'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink' import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import { ProposalStatus } from './styled' import { ProposalStatus } from './styled'
import { t, Trans } from '@lingui/macro'
const PageWrapper = styled(AutoColumn)` const PageWrapper = styled(AutoColumn)`
width: 100%; width: 100%;
...@@ -157,10 +158,14 @@ export default function VotePage({ ...@@ -157,10 +158,14 @@ export default function VotePage({
// get total votes and format percentages for UI // get total votes and format percentages for UI
const totalVotes: number | undefined = proposalData ? proposalData.forCount + proposalData.againstCount : undefined const totalVotes: number | undefined = proposalData ? proposalData.forCount + proposalData.againstCount : undefined
const forPercentage: string = const forPercentage: string = t({
proposalData && totalVotes ? ((proposalData.forCount * 100) / totalVotes).toFixed(0) + '%' : '0%' id: 'currencies.valueWithPercent',
const againstPercentage: string = message: `${proposalData && totalVotes ? ((proposalData.forCount * 100) / totalVotes).toFixed(0) : '0'} %`,
proposalData && totalVotes ? ((proposalData.againstCount * 100) / totalVotes).toFixed(0) + '%' : '0%' })
const againstPercentage: string = t({
id: 'currencies.valueWithPercent',
message: `${proposalData && totalVotes ? ((proposalData.againstCount * 100) / totalVotes).toFixed(0) : '0'} %`,
})
// only count available votes as of the proposal start block // only count available votes as of the proposal start block
const availableVotes: CurrencyAmount<Token> | undefined = useUserVotesAsOfBlock(proposalData?.startBlock ?? undefined) const availableVotes: CurrencyAmount<Token> | undefined = useUserVotesAsOfBlock(proposalData?.startBlock ?? undefined)
...@@ -198,11 +203,17 @@ export default function VotePage({ ...@@ -198,11 +203,17 @@ 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="Unlock Votes" /> <DelegateModal
isOpen={showDelegateModal}
onDismiss={toggleDelegateModal}
title={t({ id: 'vote.labels.unlockVotes', message: 'Unlock Votes' })}
/>
<ProposalInfo gap="lg" justify="start"> <ProposalInfo gap="lg" justify="start">
<RowBetween style={{ width: '100%' }}> <RowBetween style={{ width: '100%' }}>
<ArrowWrapper to="/vote"> <ArrowWrapper to="/vote">
<ArrowLeft size={20} /> All Proposals <Trans id="vote.labels.allProposals">
<ArrowLeft size={20} /> All Proposals
</Trans>
</ArrowWrapper> </ArrowWrapper>
{proposalData && ( {proposalData && (
<ProposalStatus status={proposalData.status}>{ProposalState[proposalData.status]}</ProposalStatus> <ProposalStatus status={proposalData.status}>{ProposalState[proposalData.status]}</ProposalStatus>
...@@ -212,21 +223,32 @@ export default function VotePage({ ...@@ -212,21 +223,32 @@ export default function VotePage({
<TYPE.largeHeader style={{ marginBottom: '.5rem' }}>{proposalData?.title}</TYPE.largeHeader> <TYPE.largeHeader style={{ marginBottom: '.5rem' }}>{proposalData?.title}</TYPE.largeHeader>
<RowBetween> <RowBetween>
<TYPE.main> <TYPE.main>
{endDate && endDate < now {endDate && endDate < now ? (
? 'Voting ended ' + (endDate && endDate.toLocaleString(DateTime.DATETIME_FULL)) <Trans id="vote.labels.votingEnded">
: proposalData Voting ended {endDate && endDate.toLocaleString(DateTime.DATETIME_FULL)}
? 'Voting ends approximately ' + (endDate && endDate.toLocaleString(DateTime.DATETIME_FULL)) </Trans>
: ''} ) : proposalData ? (
<Trans id="vote.labels.votingEndsApproximately">
Voting ends approximately {endDate && endDate.toLocaleString(DateTime.DATETIME_FULL)}
</Trans>
) : (
''
)}
</TYPE.main> </TYPE.main>
</RowBetween> </RowBetween>
{proposalData && proposalData.status === ProposalState.Active && !showVotingButtons && ( {proposalData && proposalData.status === ProposalState.Active && !showVotingButtons && (
<GreyCard> <GreyCard>
<TYPE.black> <TYPE.black>
Only UNI votes that were self delegated or delegated to another address before block{' '} <Trans id="vote.hint.votingEligibility">
{proposalData.startBlock} are eligible for voting.{' '} Only UNI votes that were self delegated or delegated to another address before block{' '}
{proposalData.startBlock} are eligible for voting.{' '}
</Trans>
{showLinkForUnlock && ( {showLinkForUnlock && (
<span> <span>
<StyledInternalLink to="/vote">Unlock voting</StyledInternalLink> to prepare for the next proposal. <Trans id="vote.hint.unlockVoting">
<StyledInternalLink to="/vote">Unlock voting</StyledInternalLink> to prepare for the next
proposal.
</Trans>
</span> </span>
)} )}
</TYPE.black> </TYPE.black>
...@@ -253,7 +275,7 @@ export default function VotePage({ ...@@ -253,7 +275,7 @@ export default function VotePage({
toggleVoteModal() toggleVoteModal()
}} }}
> >
Vote Against <Trans id="vote.buttons.voteAgainst">Vote Against</Trans>
</ButtonPrimary> </ButtonPrimary>
</RowFixed> </RowFixed>
) : ( ) : (
...@@ -264,11 +286,15 @@ export default function VotePage({ ...@@ -264,11 +286,15 @@ export default function VotePage({
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<WrapSmall> <WrapSmall>
<TYPE.black fontWeight={600}>For</TYPE.black> <Trans id="vote.labels.for">
<TYPE.black fontWeight={600}> <TYPE.black fontWeight={600}>
{' '} <Trans id="">For</Trans>
{proposalData?.forCount.toLocaleString(undefined, { maximumFractionDigits: 0 })} </TYPE.black>
</TYPE.black> <TYPE.black fontWeight={600}>
{' '}
{proposalData?.forCount.toLocaleString(undefined, { maximumFractionDigits: 0 })}
</TYPE.black>
</Trans>
</WrapSmall> </WrapSmall>
</AutoColumn> </AutoColumn>
<ProgressWrapper> <ProgressWrapper>
...@@ -280,7 +306,9 @@ export default function VotePage({ ...@@ -280,7 +306,9 @@ export default function VotePage({
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<WrapSmall> <WrapSmall>
<TYPE.black fontWeight={600}>Against</TYPE.black> <TYPE.black fontWeight={600}>
<Trans id="vote.labels.against">Against</Trans>
</TYPE.black>
<TYPE.black fontWeight={600}> <TYPE.black fontWeight={600}>
{proposalData?.againstCount.toLocaleString(undefined, { maximumFractionDigits: 0 })} {proposalData?.againstCount.toLocaleString(undefined, { maximumFractionDigits: 0 })}
</TYPE.black> </TYPE.black>
...@@ -293,7 +321,9 @@ export default function VotePage({ ...@@ -293,7 +321,9 @@ export default function VotePage({
</StyledDataCard> </StyledDataCard>
</CardWrapper> </CardWrapper>
<AutoColumn gap="md"> <AutoColumn gap="md">
<TYPE.mediumHeader fontWeight={600}>Details</TYPE.mediumHeader> <TYPE.mediumHeader fontWeight={600}>
<Trans id="vote.labels.details">Details</Trans>
</TYPE.mediumHeader>
{proposalData?.details?.map((d, i) => { {proposalData?.details?.map((d, i) => {
return ( return (
<DetailText key={i}> <DetailText key={i}>
...@@ -312,13 +342,17 @@ export default function VotePage({ ...@@ -312,13 +342,17 @@ export default function VotePage({
})} })}
</AutoColumn> </AutoColumn>
<AutoColumn gap="md"> <AutoColumn gap="md">
<TYPE.mediumHeader fontWeight={600}>Description</TYPE.mediumHeader> <TYPE.mediumHeader fontWeight={600}>
<Trans id="vote.labels.description">Description</Trans>
</TYPE.mediumHeader>
<MarkDownWrapper> <MarkDownWrapper>
<ReactMarkdown source={proposalData?.description} /> <ReactMarkdown source={proposalData?.description} />
</MarkDownWrapper> </MarkDownWrapper>
</AutoColumn> </AutoColumn>
<AutoColumn gap="md"> <AutoColumn gap="md">
<TYPE.mediumHeader fontWeight={600}>Proposer</TYPE.mediumHeader> <TYPE.mediumHeader fontWeight={600}>
<Trans id="vote.labels.proposer">Proposer</Trans>
</TYPE.mediumHeader>
<ProposerAddressLink <ProposerAddressLink
href={ href={
proposalData?.proposer && chainId proposalData?.proposer && chainId
......
...@@ -29,6 +29,7 @@ import Loader from '../../components/Loader' ...@@ -29,6 +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'
const PageWrapper = styled(AutoColumn)`` const PageWrapper = styled(AutoColumn)``
...@@ -138,7 +139,11 @@ export default function Vote() { ...@@ -138,7 +139,11 @@ export default function Vote() {
<DelegateModal <DelegateModal
isOpen={showDelegateModal} isOpen={showDelegateModal}
onDismiss={toggleDelegateModal} onDismiss={toggleDelegateModal}
title={showUnlockVoting ? 'Unlock Votes' : 'Update Delegation'} title={
showUnlockVoting
? t({ id: 'vote.delegates.unlockVotes', message: 'Unlock Votes' })
: t({ id: 'vote.delegates.update', message: 'Update Delegation' })
}
/> />
<TopSection gap="md"> <TopSection gap="md">
<VoteCard> <VoteCard>
...@@ -147,12 +152,16 @@ export default function Vote() { ...@@ -147,12 +152,16 @@ export default function Vote() {
<CardSection> <CardSection>
<AutoColumn gap="md"> <AutoColumn gap="md">
<RowBetween> <RowBetween>
<TYPE.white fontWeight={600}>Uniswap Governance</TYPE.white> <TYPE.white fontWeight={600}>
<Trans id="vote.labels.uniswapGovernance">Uniswap Governance</Trans>
</TYPE.white>
</RowBetween> </RowBetween>
<RowBetween> <RowBetween>
<TYPE.white fontSize={14}> <TYPE.white fontSize={14}>
UNI tokens represent voting shares in Uniswap governance. You can vote on each proposal yourself or <Trans id="vote.hints.votingShares">
delegate your votes to a third party. UNI tokens represent voting shares in Uniswap governance. You can vote on each proposal yourself or
delegate your votes to a third party.
</Trans>
</TYPE.white> </TYPE.white>
</RowBetween> </RowBetween>
<ExternalLink <ExternalLink
...@@ -160,7 +169,9 @@ export default function Vote() { ...@@ -160,7 +169,9 @@ export default function Vote() {
href="https://uniswap.org/blog/uni" href="https://uniswap.org/blog/uni"
target="_blank" target="_blank"
> >
<TYPE.white fontSize={14}>Read more about Uniswap governance</TYPE.white> <TYPE.white fontSize={14}>
<Trans id="vote.hints.readMoreUniswapGovernance">Read more about Uniswap governance</Trans>
</TYPE.white>
</ExternalLink> </ExternalLink>
</AutoColumn> </AutoColumn>
</CardSection> </CardSection>
...@@ -170,7 +181,9 @@ export default function Vote() { ...@@ -170,7 +181,9 @@ export default function Vote() {
</TopSection> </TopSection>
<TopSection gap="2px"> <TopSection gap="2px">
<WrapSmall> <WrapSmall>
<TYPE.mediumHeader style={{ margin: '0.5rem 0.5rem 0.5rem 0', flexShrink: 0 }}>Proposals</TYPE.mediumHeader> <TYPE.mediumHeader style={{ margin: '0.5rem 0.5rem 0.5rem 0', flexShrink: 0 }}>
<Trans id="vote.labels.proposals">Proposals</Trans>
</TYPE.mediumHeader>
{(!allProposals || allProposals.length === 0) && !availableVotes && <Loader />} {(!allProposals || allProposals.length === 0) && !availableVotes && <Loader />}
{showUnlockVoting ? ( {showUnlockVoting ? (
<ButtonPrimary <ButtonPrimary
...@@ -179,18 +192,22 @@ export default function Vote() { ...@@ -179,18 +192,22 @@ export default function Vote() {
borderRadius="8px" borderRadius="8px"
onClick={toggleDelegateModal} onClick={toggleDelegateModal}
> >
Unlock Voting <Trans id="vote.buttons.unlockVoting">Unlock Voting</Trans>
</ButtonPrimary> </ButtonPrimary>
) : availableVotes && JSBI.notEqual(JSBI.BigInt(0), availableVotes?.quotient) ? ( ) : availableVotes && JSBI.notEqual(JSBI.BigInt(0), availableVotes?.quotient) ? (
<TYPE.body fontWeight={500} mr="6px"> <TYPE.body fontWeight={500} mr="6px">
<FormattedCurrencyAmount currencyAmount={availableVotes} /> Votes <Trans id="vote.labels.availableVotes">
<FormattedCurrencyAmount currencyAmount={availableVotes} /> Votes
</Trans>
</TYPE.body> </TYPE.body>
) : uniBalance && ) : uniBalance &&
userDelegatee && userDelegatee &&
userDelegatee !== ZERO_ADDRESS && userDelegatee !== ZERO_ADDRESS &&
JSBI.notEqual(JSBI.BigInt(0), uniBalance?.quotient) ? ( JSBI.notEqual(JSBI.BigInt(0), uniBalance?.quotient) ? (
<TYPE.body fontWeight={500} mr="6px"> <TYPE.body fontWeight={500} mr="6px">
<FormattedCurrencyAmount currencyAmount={uniBalance} /> Votes <Trans id="vote.labels.availableVotes">
<FormattedCurrencyAmount currencyAmount={uniBalance} /> Votes
</Trans>
</TYPE.body> </TYPE.body>
) : ( ) : (
'' ''
...@@ -202,17 +219,21 @@ export default function Vote() { ...@@ -202,17 +219,21 @@ export default function Vote() {
{userDelegatee && userDelegatee !== ZERO_ADDRESS ? ( {userDelegatee && userDelegatee !== ZERO_ADDRESS ? (
<RowFixed> <RowFixed>
<TYPE.body fontWeight={500} mr="4px"> <TYPE.body fontWeight={500} mr="4px">
Delegated to: <Trans id="vote.labels.delegatedTo">Delegated to:</Trans>
</TYPE.body> </TYPE.body>
<AddressButton> <AddressButton>
<StyledExternalLink <StyledExternalLink
href={getExplorerLink(1, userDelegatee, ExplorerDataType.ADDRESS)} href={getExplorerLink(1, userDelegatee, ExplorerDataType.ADDRESS)}
style={{ margin: '0 4px' }} style={{ margin: '0 4px' }}
> >
{userDelegatee === account ? 'Self' : shortenAddress(userDelegatee)} {userDelegatee === account ? (
<Trans id="vote.labels.self">Self</Trans>
) : (
shortenAddress(userDelegatee)
)}
</StyledExternalLink> </StyledExternalLink>
<TextButton onClick={toggleDelegateModal} style={{ marginLeft: '4px' }}> <TextButton onClick={toggleDelegateModal} style={{ marginLeft: '4px' }}>
(edit) <Trans id="vote.buttons.edit">(edit)</Trans>
</TextButton> </TextButton>
</AddressButton> </AddressButton>
</RowFixed> </RowFixed>
...@@ -223,9 +244,15 @@ export default function Vote() { ...@@ -223,9 +244,15 @@ export default function Vote() {
)} )}
{allProposals?.length === 0 && ( {allProposals?.length === 0 && (
<EmptyProposals> <EmptyProposals>
<TYPE.body style={{ marginBottom: '8px' }}>No proposals found.</TYPE.body> <TYPE.body style={{ marginBottom: '8px' }}>
<Trans id="vote.labels.noProposalsFound">No proposals found.</Trans>
</TYPE.body>
<TYPE.subHeader> <TYPE.subHeader>
<i>Proposals submitted by community members will appear here.</i> <i>
<Trans id="vote.hints.proposalSubmitted">
Proposals submitted by community members will appear here.
</Trans>
</i>
</TYPE.subHeader> </TYPE.subHeader>
</EmptyProposals> </EmptyProposals>
)} )}
...@@ -240,7 +267,9 @@ export default function Vote() { ...@@ -240,7 +267,9 @@ export default function Vote() {
})} })}
</TopSection> </TopSection>
<TYPE.subHeader color="text3"> <TYPE.subHeader color="text3">
A minimum threshold of 1% of the total UNI supply is required to submit proposals <Trans id="vote.hints.submissionThreshold">
A minimum threshold of 1% of the total UNI supply is required to submit proposals
</Trans>
</TYPE.subHeader> </TYPE.subHeader>
</PageWrapper> </PageWrapper>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment