Compare commits
230 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55ea6616a4 | ||
|
|
5dd1249ddd | ||
|
|
4ab2bd3474 | ||
|
|
9eb20624cb | ||
|
|
25c5cf04e6 | ||
|
|
1f70e63cd0 | ||
|
|
df88b0ddd1 | ||
|
|
679759c3a0 | ||
|
|
9b6003bdc5 | ||
|
|
2b32824c26 | ||
|
|
a4e4cf8ab9 | ||
|
|
f08cea1820 | ||
|
|
e2d35c56fc | ||
|
|
5f20040107 | ||
|
|
9344abd1cf | ||
|
|
426e31230d | ||
|
|
06c48559c5 | ||
|
|
0a33ed1a50 | ||
|
|
d5c490b871 | ||
|
|
099c2adea3 | ||
|
|
d387538576 | ||
|
|
a3a7d01ce9 | ||
|
|
549e67bcea | ||
|
|
932992b57f | ||
|
|
76a24376d4 | ||
|
|
f873b2249f | ||
|
|
22452c03b0 | ||
|
|
14e045b999 | ||
|
|
948781f927 | ||
|
|
2f72d6b77e | ||
|
|
a78209690d | ||
|
|
98a2f51125 | ||
|
|
a1043573af | ||
|
|
63760faa9d | ||
|
|
0566ec28be | ||
|
|
d4c1baba57 | ||
|
|
7e41b27cd3 | ||
|
|
1d18a5159f | ||
|
|
bb87d2dd03 | ||
|
|
0b27528a6a | ||
|
|
5788a273ba | ||
|
|
4d322b17da | ||
|
|
cb5b80b558 | ||
|
|
6964b519bc | ||
|
|
ee4ea2a1f0 | ||
|
|
3763ad15e0 | ||
|
|
557042a88f | ||
|
|
860413dd52 | ||
|
|
18d4cdcce4 | ||
|
|
55767de484 | ||
|
|
60d5cef69b | ||
|
|
ad2833a3ed | ||
|
|
e4a105714a | ||
|
|
3e842d3259 | ||
|
|
e9d18acd41 | ||
|
|
abeba3d6b6 | ||
|
|
84c4219c02 | ||
|
|
50b81c8334 | ||
|
|
8986b63335 | ||
|
|
631b4c08b6 | ||
|
|
b92f0b8d90 | ||
|
|
ce926e91b7 | ||
|
|
4857281a1e | ||
|
|
d2a872e7d2 | ||
|
|
73042f20fd | ||
|
|
29b5e583c5 | ||
|
|
d67f3158bd | ||
|
|
817732d62e | ||
|
|
562a54a175 | ||
|
|
cd1e0cf378 | ||
|
|
0c81b08d66 | ||
|
|
2662f8afbc | ||
|
|
355012eec9 | ||
|
|
68518d7ce0 | ||
|
|
2c9c99b868 | ||
|
|
7b78dfa2c4 | ||
|
|
e6cbab3c72 | ||
|
|
144f86bdfd | ||
|
|
6703743aef | ||
|
|
0320083909 | ||
|
|
b96f7d27ca | ||
|
|
45e85bc857 | ||
|
|
24e1a01b1a | ||
|
|
0e7a94313c | ||
|
|
35e80fa3ed | ||
|
|
4a70d8eb28 | ||
|
|
706d8724c1 | ||
|
|
6e363c1ff1 | ||
|
|
27007708ec | ||
|
|
c4739ea963 | ||
|
|
50954eff0f | ||
|
|
af112765e4 | ||
|
|
52b71004d0 | ||
|
|
2ba7c857cd | ||
|
|
67f3b40671 | ||
|
|
c2acf5c1a8 | ||
|
|
51cf8aa0da | ||
|
|
bc0e578610 | ||
|
|
1b13cac0fb | ||
|
|
14ed4dbb2e | ||
|
|
dc140901b3 | ||
|
|
07a92ba63b | ||
|
|
3f2f46df43 | ||
|
|
2dc5c0d386 | ||
|
|
38de86f4c9 | ||
|
|
b2196e7e48 | ||
|
|
30f66f7062 | ||
|
|
b87430277a | ||
|
|
b4c59cfc6e | ||
|
|
2326dfa108 | ||
|
|
97bf36efbf | ||
|
|
264acaae48 | ||
|
|
63e9f6e4d2 | ||
|
|
02d80e07dc | ||
|
|
ad53da5efe | ||
|
|
29223ce34f | ||
|
|
b88919ed69 | ||
|
|
ab80910553 | ||
|
|
1cdb8aa6a4 | ||
|
|
88976d0294 | ||
|
|
b908c81e2b | ||
|
|
5c20d0adb7 | ||
|
|
ca6295fcb7 | ||
|
|
e8af59198d | ||
|
|
cd4c43b482 | ||
|
|
c1e07f3713 | ||
|
|
bccda20473 | ||
|
|
bed8dd5110 | ||
|
|
6bcbabec23 | ||
|
|
71a490f2aa | ||
|
|
abcf1f5a5c | ||
|
|
65e5e9c98e | ||
|
|
fdabb90f0e | ||
|
|
049054f5bb | ||
|
|
91d0a002c9 | ||
|
|
305d2e1df9 | ||
|
|
6bb7d9d9b2 | ||
|
|
55d5762e39 | ||
|
|
979686100e | ||
|
|
a7a1607faa | ||
|
|
5125cbb1a3 | ||
|
|
e89387bb26 | ||
|
|
f7896db5aa | ||
|
|
0a0053c6f1 | ||
|
|
9e10abbf97 | ||
|
|
c38771a6aa | ||
|
|
8e364680b6 | ||
|
|
04c25685f7 | ||
|
|
be1e184d88 | ||
|
|
b485b14395 | ||
|
|
44ef0138de | ||
|
|
a1142cc7af | ||
|
|
089280ddf0 | ||
|
|
f3c2a6eaea | ||
|
|
54dc5b1f19 | ||
|
|
0af7651c0b | ||
|
|
61d9dfe127 | ||
|
|
d990dfdec7 | ||
|
|
4336e08233 | ||
|
|
3840daf365 | ||
|
|
1104bdcefc | ||
|
|
499ef27722 | ||
|
|
1ea0769ba3 | ||
|
|
637d43621b | ||
|
|
9831cda290 | ||
|
|
62d4bb8b51 | ||
|
|
58a1be8421 | ||
|
|
40b939df58 | ||
|
|
3ccecc5ca1 | ||
|
|
9df5b536c9 | ||
|
|
4b72d757c5 | ||
|
|
63affd9828 | ||
|
|
135f9dc219 | ||
|
|
08b74b2524 | ||
|
|
ffcea6388e | ||
|
|
408a07ebd4 | ||
|
|
7f837810e0 | ||
|
|
57a7a4995a | ||
|
|
cc66783278 | ||
|
|
f97dcaef1d | ||
|
|
cfea3723a2 | ||
|
|
7d0fb9cc10 | ||
|
|
8633dc7a50 | ||
|
|
f340537544 | ||
|
|
3e9289dc35 | ||
|
|
4eb5c3cac8 | ||
|
|
cfadd3b165 | ||
|
|
d6db79b8f5 | ||
|
|
6007527ce0 | ||
|
|
06c8db917f | ||
|
|
3394bc738f | ||
|
|
32b56ba0fd | ||
|
|
f97ce35cee | ||
|
|
0dafd3e7ba | ||
|
|
d719942931 | ||
|
|
62b9b5d527 | ||
|
|
ab34645073 | ||
|
|
dab3671cfe | ||
|
|
478cb3afa3 | ||
|
|
d56015d750 | ||
|
|
a639e65cee | ||
|
|
243e14b74e | ||
|
|
70174140bc | ||
|
|
4fede9df36 | ||
|
|
fbd5dab53e | ||
|
|
ecdce21b16 | ||
|
|
1a38309500 | ||
|
|
46f539c604 | ||
|
|
ad65b63868 | ||
|
|
f9a5dbf6ce | ||
|
|
7991b0b0d8 | ||
|
|
d85dccd01a | ||
|
|
37799caa03 | ||
|
|
04878e095c | ||
|
|
14a6953b90 | ||
|
|
d866d79578 | ||
|
|
7f1def300d | ||
|
|
8930627064 | ||
|
|
efb939297f | ||
|
|
69cc728d43 | ||
|
|
a6bc7775bc | ||
|
|
3452be9a45 | ||
|
|
be6e2fe74a | ||
|
|
83b1297ff6 | ||
|
|
a20ed15b00 | ||
|
|
1413ab91bf | ||
|
|
c4846c8832 | ||
|
|
dbbffd17a6 | ||
|
|
85d8b1e514 | ||
|
|
739986ba66 |
2
.env
@@ -1,4 +1,2 @@
|
||||
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847"
|
||||
REACT_APP_WALLETCONNECT_BRIDGE_URL="https://uniswap.bridge.walletconnect.org"
|
||||
# Because we use storybook which has its own babel-loader dependency @ 8.2.2, where react-scripts uses 8.1.0
|
||||
SKIP_PREFLIGHT_CHECK=true
|
||||
57
.github/workflows/crowdin-sync.yaml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Crowdin Download
|
||||
|
||||
# hourly we sync translations from Crowdin
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *' # every hour we download translations and update the pr from crowdin
|
||||
|
||||
# manual trigger
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
download-translations:
|
||||
name: Download translations
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Extract translations
|
||||
run: "yarn i18n:extract"
|
||||
|
||||
- name: Synchronize
|
||||
uses: crowdin/github-action@1.1.0
|
||||
with:
|
||||
upload_sources: false
|
||||
download_translations: true
|
||||
project_id: 458284
|
||||
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN_SECRET }}
|
||||
source: 'src/locales/en-US.po'
|
||||
translation: 'src/locales/%locale%.po'
|
||||
create_pull_request: false
|
||||
localization_branch_name: main
|
||||
commit_message: "chore(i18n): synchronize translations from crowdin [skip ci]"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
52
.github/workflows/crowdin.yaml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Crowdin Upload
|
||||
|
||||
# on any push to main, we upload the translations to be translated
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
synchronize-with-crowdin:
|
||||
name: Upload sources to Crowdin
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Extract translations
|
||||
run: "yarn i18n:extract"
|
||||
|
||||
- name: Synchronize
|
||||
uses: crowdin/github-action@1.1.0
|
||||
with:
|
||||
upload_sources: true
|
||||
download_translations: false
|
||||
project_id: 458284
|
||||
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN_SECRET }}
|
||||
source: 'src/locales/en-US.po'
|
||||
translation: 'src/locales/%locale%.po'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
12
.github/workflows/integration-tests.yaml
vendored
@@ -22,6 +22,18 @@ jobs:
|
||||
node-version: 14
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
|
||||
12
.github/workflows/lint.yml
vendored
@@ -23,6 +23,18 @@ jobs:
|
||||
node-version: 14
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
|
||||
12
.github/workflows/unit-tests.yaml
vendored
@@ -21,6 +21,18 @@ jobs:
|
||||
node-version: 14
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
|
||||
4
.gitignore
vendored
@@ -3,6 +3,10 @@
|
||||
# generated contract types
|
||||
/src/types/v3
|
||||
/src/abis/types
|
||||
/src/locales/**/*.js
|
||||
/src/locales/**/*.ts
|
||||
/src/locales/**/*.json
|
||||
/src/locales/**/en-US.po
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
const { dirname, join, parse, resolve } = require('path')
|
||||
const { existsSync } = require('fs')
|
||||
|
||||
module.exports = {
|
||||
stories: ['../src/**/*.stories.@(ts|tsx)'],
|
||||
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'],
|
||||
typescript: {
|
||||
check: true,
|
||||
checkOptions: {},
|
||||
reactDocgen: 'react-docgen-typescript',
|
||||
reactDocgenTypescriptOptions: {
|
||||
shouldExtractLiteralValuesFromEnum: true,
|
||||
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import { addons } from '@storybook/addons'
|
||||
import { light } from './theme'
|
||||
|
||||
addons.setConfig({ theme: light })
|
||||
@@ -1,91 +0,0 @@
|
||||
import 'inter-ui'
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
|
||||
import React from 'react'
|
||||
import { Provider as StoreProvider } from 'react-redux'
|
||||
import { ThemeProvider as SCThemeProvider } from 'styled-components'
|
||||
import { NetworkContextName } from '../src/constants/misc'
|
||||
import store from '../src/state'
|
||||
import { FixedGlobalStyle, theme, ThemedGlobalStyle } from '../src/theme'
|
||||
import getLibrary from '../src/utils/getLibrary'
|
||||
import * as storybookThemes from './theme'
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
dependencies: {
|
||||
withStoriesOnly: true,
|
||||
hideEmpty: true,
|
||||
},
|
||||
docs: {
|
||||
theme: storybookThemes.light,
|
||||
},
|
||||
viewport: {
|
||||
viewports: {
|
||||
mobile: {
|
||||
name: 'iPhone X',
|
||||
styles: {
|
||||
width: '375px',
|
||||
height: '812px',
|
||||
},
|
||||
},
|
||||
tablet: {
|
||||
name: 'iPad',
|
||||
styles: {
|
||||
width: '768px',
|
||||
height: '1024px',
|
||||
},
|
||||
},
|
||||
laptop: {
|
||||
name: 'Laptop',
|
||||
styles: {
|
||||
width: '1024px',
|
||||
height: '768px',
|
||||
},
|
||||
},
|
||||
desktop: {
|
||||
name: 'Desktop',
|
||||
styles: {
|
||||
width: '1440px',
|
||||
height: '1024px',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
name: 'Theme',
|
||||
description: 'Global theme for components',
|
||||
defaultValue: 'light',
|
||||
toolbar: {
|
||||
icon: 'circlehollow',
|
||||
items: ['light', 'dark'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
|
||||
|
||||
const withProviders = (Component: Story, context: Record<string, any>) => {
|
||||
const THEME = theme(context.globals.theme === 'dark')
|
||||
return (
|
||||
<>
|
||||
<Web3ReactProvider getLibrary={getLibrary}>
|
||||
<Web3ProviderNetwork getLibrary={getLibrary}>
|
||||
<StoreProvider store={store}>
|
||||
<SCThemeProvider theme={THEME}>
|
||||
<FixedGlobalStyle />
|
||||
<ThemedGlobalStyle />
|
||||
<main>
|
||||
<Component />
|
||||
</main>
|
||||
</SCThemeProvider>
|
||||
</StoreProvider>
|
||||
</Web3ProviderNetwork>
|
||||
</Web3ReactProvider>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export const decorators = [withProviders]
|
||||
@@ -1,17 +0,0 @@
|
||||
import { create } from '@storybook/theming'
|
||||
|
||||
// this themes the storybook UI
|
||||
const uniswapBaseTheme = {
|
||||
brandTitle: 'Uniswap Design',
|
||||
brandUrl: 'https://uniswap.org',
|
||||
brandImage: 'https://ipfs.io/ipfs/QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir',
|
||||
}
|
||||
export const light = create({
|
||||
base: 'light',
|
||||
...uniswapBaseTheme,
|
||||
})
|
||||
|
||||
// export const dark = create({
|
||||
// base: 'dark',
|
||||
// ...uniswapBaseTheme,
|
||||
// })
|
||||
47
CONTRIBUTING.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Development
|
||||
|
||||
## Install Dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Generate locale files
|
||||
|
||||
```
|
||||
yarn i18n:extract
|
||||
```
|
||||
|
||||
## Run the interface
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
# Contributing
|
||||
|
||||
Thank you for your interest in contributing to the Uniswap interface! 🦄
|
||||
|
||||
## Finding a first issue
|
||||
|
||||
Start with issues with the label
|
||||
[`good first issue`](https://github.com/Uniswap/uniswap-interface/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
|
||||
|
||||
## Pull requests
|
||||
|
||||
**Please open all pull requests against the `main` branch.**
|
||||
CI checks will run against all PRs.
|
||||
|
||||
# Translations
|
||||
|
||||
Help Uniswap reach a global audience!
|
||||
|
||||
Uniswap uses [Crowdin](https://crowdin.com/project/uniswap-interface)
|
||||
for managing translations. Whenever a new string is added to the project,
|
||||
it gets uploaded to Crowdin for translation by [this workflow](./.github/workflows/crowdin.yaml).
|
||||
|
||||
Every hour, translations are synced from Crowdin in [this other workflow](./.github/workflows/crowdin-sync.yaml).
|
||||
|
||||
You can contribute by joining Crowdin to proofread existing translations [here](https://crowdin.com/project/uniswap-interface/invite?d=93i5n413q403t4g473p443o4c3t2g3s21343u2c3n403l4b3v2735353i4g4k4l4g453j4g4o4j4e4k4b323l4a3h463s4g453q443m4e3t2b303s2a35353l403o443v293e303k4g4n4r4g483i4g4r4j4e4o473i5n4a3t463t4o4)
|
||||
|
||||
Or, ask to join us as a translator in the Discord!
|
||||
20
README.md
@@ -4,13 +4,14 @@
|
||||
[](https://github.com/Uniswap/uniswap-interface/actions/workflows/integration-tests.yaml)
|
||||
[](https://github.com/Uniswap/uniswap-interface/actions/workflows/lint.yml)
|
||||
[](https://github.com/Uniswap/uniswap-interface/actions/workflows/release.yaml)
|
||||
[](https://crowdin.com/project/uniswap-interface)
|
||||
|
||||
An open source interface for Uniswap -- a protocol for decentralized exchange of Ethereum tokens.
|
||||
|
||||
- Website: [uniswap.org](https://uniswap.org/)
|
||||
- Interface: [app.uniswap.org](https://app.uniswap.org)
|
||||
- Docs: [uniswap.org/docs/](https://uniswap.org/docs/)
|
||||
- Twitter: [@UniswapProtocol](https://twitter.com/UniswapProtocol)
|
||||
- Twitter: [@Uniswap](https://twitter.com/Uniswap)
|
||||
- Reddit: [/r/Uniswap](https://www.reddit.com/r/Uniswap/)
|
||||
- Email: [contact@uniswap.org](mailto:contact@uniswap.org)
|
||||
- Discord: [Uniswap](https://discord.gg/FCfyBSbCU5)
|
||||
@@ -25,24 +26,9 @@ To access the Uniswap Interface, use an IPFS gateway link from the
|
||||
[latest release](https://github.com/Uniswap/uniswap-interface/releases/latest),
|
||||
or visit [app.uniswap.org](https://app.uniswap.org).
|
||||
|
||||
## Development
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Run
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
## Contributions
|
||||
|
||||
**Please open all pull requests against the `main` branch.**
|
||||
CI checks will run against all PRs.
|
||||
See [CONTRIBUTING](./CONTRIBUTING.md).
|
||||
|
||||
## Accessing Uniswap V2
|
||||
|
||||
|
||||
53
lingui.config.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
export default {
|
||||
catalogs: [
|
||||
{
|
||||
path: '<rootDir>/src/locales/{locale}',
|
||||
include: ['<rootDir>/src'],
|
||||
},
|
||||
],
|
||||
compileNamespace: 'cjs',
|
||||
fallbackLocales: {
|
||||
default: 'en-US',
|
||||
},
|
||||
format: 'po',
|
||||
formatOptions: {
|
||||
lineNumbers: false,
|
||||
},
|
||||
locales: [
|
||||
'af-ZA',
|
||||
'ar-SA',
|
||||
'ca-ES',
|
||||
'cs-CZ',
|
||||
'da-DK',
|
||||
'de-DE',
|
||||
'el-GR',
|
||||
'en-US',
|
||||
'es-ES',
|
||||
'fi-FI',
|
||||
'fr-FR',
|
||||
'he-IL',
|
||||
'hu-HU',
|
||||
'id-ID',
|
||||
'it-IT',
|
||||
'ja-JP',
|
||||
'ko-KR',
|
||||
'nl-NL',
|
||||
'no-NO',
|
||||
'pl-PL',
|
||||
'pt-BR',
|
||||
'pt-PT',
|
||||
'ro-RO',
|
||||
'ru-RU',
|
||||
'sr-SP',
|
||||
'sv-SE',
|
||||
'tr-TR',
|
||||
'uk-UA',
|
||||
'vi-VN',
|
||||
'zh-CN',
|
||||
'zh-TW',
|
||||
],
|
||||
orderBy: 'messageId',
|
||||
rootDir: '.',
|
||||
runtimeConfigModule: ['@lingui/core', 'i18n'],
|
||||
sourceLocale: 'en-US',
|
||||
}
|
||||
27
package.json
@@ -4,26 +4,22 @@
|
||||
"homepage": ".",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@emotion/core": "^11.0.0",
|
||||
"@ethersproject/experimental": "^5.2.0",
|
||||
"@lingui/cli": "^3.9.0",
|
||||
"@lingui/loader": "^3.9.0",
|
||||
"@lingui/macro": "^3.9.0",
|
||||
"@lingui/react": "^3.9.0",
|
||||
"@metamask/jazzicon": "^2.0.0",
|
||||
"@popperjs/core": "^2.4.4",
|
||||
"@reach/dialog": "^0.10.3",
|
||||
"@reach/portal": "^0.10.3",
|
||||
"@react-hook/window-scroll": "^1.3.0",
|
||||
"@reduxjs/toolkit": "^1.3.5",
|
||||
"@storybook/addon-actions": "^6.1.17",
|
||||
"@storybook/addon-essentials": "^6.1.17",
|
||||
"@storybook/addon-links": "^6.1.17",
|
||||
"@storybook/addons": "^6.1.17",
|
||||
"@storybook/components": "^6.1.17",
|
||||
"@storybook/preset-create-react-app": "^3.1.5",
|
||||
"@storybook/preset-typescript": "^3.0.0",
|
||||
"@storybook/react": "^6.1.17",
|
||||
"@storybook/theming": "^6.1.17",
|
||||
"@styled-system/css": "^5.1.5",
|
||||
"@typechain/ethers-v5": "^7.0.0",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/lingui__core": "^2.7.1",
|
||||
"@types/lingui__macro": "^2.7.4",
|
||||
"@types/lingui__react": "^2.8.3",
|
||||
"@types/lodash.flatmap": "^4.5.6",
|
||||
"@types/luxon": "^1.24.4",
|
||||
"@types/multicodec": "^1.0.0",
|
||||
@@ -70,9 +66,6 @@
|
||||
"eslint-plugin-react": "^7.19.0",
|
||||
"eslint-plugin-react-hooks": "^4.0.0",
|
||||
"ethers": "^5.2.0",
|
||||
"i18next": "^15.0.9",
|
||||
"i18next-browser-languagedetector": "^3.0.1",
|
||||
"i18next-xhr-backend": "^2.0.1",
|
||||
"inter-ui": "^3.13.1",
|
||||
"lightweight-charts": "^3.3.0",
|
||||
"lodash.flatmap": "^4.5.0",
|
||||
@@ -89,7 +82,6 @@
|
||||
"react-dom": "^17.0.1",
|
||||
"react-feather": "^2.0.8",
|
||||
"react-ga": "^2.5.7",
|
||||
"react-i18next": "^10.7.0",
|
||||
"react-markdown": "^4.3.1",
|
||||
"react-popper": "^2.2.3",
|
||||
"react-redux": "^7.2.2",
|
||||
@@ -123,11 +115,12 @@
|
||||
"compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-contract-types",
|
||||
"compile-external-abi-types": "typechain --target ethers-v5 --out-dir src/abis/types './src/abis/**/*.json'",
|
||||
"compile-v3-contract-types": "typechain --target ethers-v5 --out-dir src/types/v3 './node_modules/@uniswap/?(v3-core|v3-periphery)/artifacts/contracts/**/*.json'",
|
||||
"build": "yarn compile-contract-types && react-scripts build",
|
||||
"build": "yarn compile-contract-types && yarn i18n:extract && yarn i18n:compile && react-scripts build",
|
||||
"i18n:extract": "lingui extract --locale en-US",
|
||||
"i18n:compile": "lingui compile",
|
||||
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'",
|
||||
"postinstall": "yarn compile-contract-types",
|
||||
"start": "yarn compile-contract-types && react-scripts start",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"test": "react-scripts test --env=jsdom"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html translate="no">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="shortcut icon" type="image/png" href="%PUBLIC_URL%/favicon.png" />
|
||||
@@ -24,11 +24,80 @@
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
|
||||
<style>
|
||||
* {
|
||||
font-family: 'Inter', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@supports (font-variation-settings: normal) {
|
||||
* {
|
||||
font-family: 'Inter var', sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
font-variant: none;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
font-feature-settings: 'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on;
|
||||
}
|
||||
|
||||
#background-radial-gradient {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
width: 200vw;
|
||||
height: 200vh;
|
||||
mix-blend-mode: color;
|
||||
background: radial-gradient(50% 50% at 50% 50%, #fc077d10 0%, rgba(255, 255, 255, 0) 100%);
|
||||
transform: translate(-50vw, -100vh);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
html {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
background-color: #212429;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
html {
|
||||
background-color: #F7F8FA;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>Uniswap Interface</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<!-- The root is the container of the app -->
|
||||
<div id="root">
|
||||
<!-- Triggers the font to load immediately and then is replaced by the app -->
|
||||
<div style="visibility: hidden">X</div>
|
||||
</div>
|
||||
|
||||
<div id="background-radial-gradient"></div>
|
||||
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
{
|
||||
"noWallet": "Keine Ethereum-Wallet gefunden",
|
||||
"wrongNetwork": "Du bist auf dem falschen Netzwerk.",
|
||||
"switchNetwork": "Bitte wechsle zum {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Bitte besuche uns mit einem web3-fähigen mobilen Browser wie z.B. Trust Wallet oder Coinbase Wallet.",
|
||||
"installMetamask": "Bitte besuch uns erneut, nachdem du Metamask oder Brave installiert hast.",
|
||||
"disconnected": "Nicht verbunden",
|
||||
"swap": "Tauschen",
|
||||
"swapAnyway": "Trotzdem tauschen",
|
||||
"send": "Senden",
|
||||
"sendAnyway": "Trotzdem senden",
|
||||
"pool": "Pool",
|
||||
"betaWarning": "Dieses Projekt ist in beta. Nutzung auf eigenes Risiko.",
|
||||
"input": "Input",
|
||||
"output": "Output",
|
||||
"estimated": "geschätzt",
|
||||
"balance": "Guthaben: {{ balanceInput }}",
|
||||
"unlock": "Freischalten",
|
||||
"pending": "hängige",
|
||||
"selectToken": "Token auswählen",
|
||||
"searchOrPaste": "Token Name, Symbol oder Adresse suchen",
|
||||
"searchOrPasteMobile": "Name, Symbol oder Adresse",
|
||||
"noExchange": "Exchange nicht gefunden",
|
||||
"exchangeRate": "Wechselkurs",
|
||||
"invertedRate": "Invertierter Wechselkurs",
|
||||
"unknownError": "Oops! Ein unbekannter Fehler ist aufgetreten. Bitte Seite neu laden oder uns von einem anderen Browser oder Gerät erneut besuchen.",
|
||||
"enterValueCont": "Wert {{ missingCurrencyValue }} eingeben um fortzufahren.",
|
||||
"selectTokenCont": "Token auswählen um fortzufahren.",
|
||||
"noLiquidity": "Keine Liquidität.",
|
||||
"insufficientLiquidity": "Liquidität ungenügend.",
|
||||
"unlockTokenCont": "Token freischalten um fortzufahren.",
|
||||
"transactionDetails": "Details der Transaktion",
|
||||
"hideDetails": "Details ausblenden",
|
||||
"slippageWarning": "Wechselkursrutsch",
|
||||
"highSlippageWarning": "Hoher Wechselkursrutsch",
|
||||
"youAreSelling": "Du verkaufst",
|
||||
"orTransFail": "oder die Transaktion wird fehlschlagen.",
|
||||
"youWillReceive": "Du erhältst mindestens",
|
||||
"youAreBuying": "Du kaufst",
|
||||
"itWillCost": "Es kostet höchstens",
|
||||
"forAtMost": "für maximal",
|
||||
"insufficientBalance": "Guthaben ungenügend",
|
||||
"inputNotValid": "Eingabewert ungültig",
|
||||
"differentToken": "Es müssen unterschiedliche Token sein.",
|
||||
"noRecipient": "Empfängeradresse angeben.",
|
||||
"invalidRecipient": "Bitte gib eine gültige Empfängeradresse an.",
|
||||
"recipientAddress": "Adresse des Empfängers",
|
||||
"youAreSending": "Du schickst",
|
||||
"willReceive": "erhält mindestens",
|
||||
"to": "zu",
|
||||
"addLiquidity": "Liquidität hinzufügen",
|
||||
"deposit": "Depot",
|
||||
"currentPoolSize": "Aktuelle Größe des Pools",
|
||||
"yourPoolShare": "Dein Anteil am Pool",
|
||||
"noZero": "Wert darf nicht Null sein.",
|
||||
"mustBeETH": "Einer der Inputs muß ETH sein.",
|
||||
"enterCurrencyOrLabelCont": "{{ inputCurrency }} oder {{ label }} Wert eingeben um fortzufahren.",
|
||||
"youAreAdding": "Du fügst zwischen",
|
||||
"and": "und",
|
||||
"intoPool": "in den Liquiditätspool.",
|
||||
"outPool": "vom Liquiditätspool.",
|
||||
"youWillMint": "Du prägst",
|
||||
"liquidityTokens": "Liquiditätstokens.",
|
||||
"totalSupplyIs": "Die gesamte Anzahl Liquiditätstokens ist aktuell",
|
||||
"youAreSettingExRate": "Du setzt den anfänglichen Wechselkurs auf",
|
||||
"totalSupplyIs0": "Die gesamte Anzahl Liquiditätstokens ist aktuell 0.",
|
||||
"tokenWorth": "Zum gegenwärtigen Wechselkurs ist jeder Pool Token so viel Wert",
|
||||
"firstLiquidity": "Du bist die erste Person die Liquidität bereitstellt!",
|
||||
"initialExchangeRate": "Der initiale Wechselkurs wird auf deiner Überweisung basieren. Stelle sicher, dass deine ETH und {{ label }} denselben Fiatwert haben.",
|
||||
"removeLiquidity": "Liquidität entfernen",
|
||||
"poolTokens": "Pool Tokens",
|
||||
"enterLabelCont": "{{ label }} Wert eingeben um fortzufahren.",
|
||||
"youAreRemoving": "Du entfernst zwischen",
|
||||
"youWillRemove": "Du entfernst",
|
||||
"createExchange": "Exchange erstellen",
|
||||
"invalidTokenAddress": "Ungültige Tokenadresse",
|
||||
"exchangeExists": "{{ label }} Exchange existiert bereits!",
|
||||
"invalidSymbol": "Symbol ungültig",
|
||||
"invalidDecimals": "Dezimalstellen ungültig",
|
||||
"tokenAddress": "Tokenadresse",
|
||||
"label": "Label",
|
||||
"name": "Name",
|
||||
"symbol": "Symbol",
|
||||
"decimals": "Dezimalstellen",
|
||||
"enterTokenCont": "Tokenadresse eingeben um fortzufahren",
|
||||
"priceChange": "Geschätzter Wechselkursrutsch",
|
||||
"forAtLeast": "für mindestens ",
|
||||
"brokenToken": "Der ausgewählte Token ist nicht kompatibel mit Uniswap V1. Liquidität hinzufügen wird zu nicht mehr zugänglichen Token führen!"
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
{
|
||||
"noWallet": "No Ethereum wallet found",
|
||||
"wrongNetwork": "You are on the wrong network",
|
||||
"switchNetwork": "Please switch to {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Please visit us from a web3-enabled mobile browser such as Trust Wallet or Coinbase Wallet.",
|
||||
"installMetamask": "Please visit us after installing Metamask on Chrome or Brave.",
|
||||
"disconnected": "Disconnected",
|
||||
"swap": "Swap",
|
||||
"swapAnyway": "Swap Anyway",
|
||||
"send": "Send",
|
||||
"sendAnyway": "Send Anyway",
|
||||
"pool": "Pool",
|
||||
"betaWarning": "This project is in beta. Use at your own risk.",
|
||||
"input": "Input",
|
||||
"output": "Output",
|
||||
"estimated": "estimated",
|
||||
"balance": "Balance: {{ balanceInput }}",
|
||||
"unlock": "Unlock",
|
||||
"pending": "Pending",
|
||||
"selectToken": "Select a token",
|
||||
"searchOrPaste": "Search Token Name, Symbol, or Address",
|
||||
"searchOrPasteMobile": "Name, Symbol, or Address",
|
||||
"noExchange": "No Exchange Found",
|
||||
"noToken": "No Token Found",
|
||||
"exchangeRate": "Exchange Rate",
|
||||
"unknownError": "Oops! An unknown error occurred. Please refresh the page, or visit from another browser or device.",
|
||||
"enterValueCont": "Enter a {{ missingCurrencyValue }} value to continue.",
|
||||
"selectTokenCont": "Select a token to continue.",
|
||||
"noLiquidity": "No liquidity.",
|
||||
"insufficientLiquidity": "Insufficient liquidity.",
|
||||
"unlockTokenCont": "Please unlock token to continue.",
|
||||
"transactionDetails": "Advanced Details",
|
||||
"hideDetails": "Hide Details",
|
||||
"slippageWarning": "Slippage Warning",
|
||||
"highSlippageWarning": "High Slippage Warning",
|
||||
"youAreSelling": "You are selling",
|
||||
"orTransFail": "or the transaction will fail.",
|
||||
"youWillReceive": "You will receive at least",
|
||||
"youAreBuying": "You are buying",
|
||||
"itWillCost": "It will cost at most",
|
||||
"forAtMost": "for at most",
|
||||
"insufficientBalance": "Insufficient Balance",
|
||||
"inputNotValid": "Not a valid input value",
|
||||
"differentToken": "Must be different token.",
|
||||
"noRecipient": "Enter a wallet address to send to.",
|
||||
"invalidRecipient": "Please enter a valid wallet address recipient.",
|
||||
"recipientAddress": "Recipient Address",
|
||||
"youAreSending": "You are sending",
|
||||
"willReceive": "will receive at least",
|
||||
"to": "to",
|
||||
"addLiquidity": "Add Liquidity",
|
||||
"deposit": "Deposit",
|
||||
"currentPoolSize": "Current Pool Size",
|
||||
"yourPoolShare": "Your Pool Share",
|
||||
"noZero": "Amount cannot be zero.",
|
||||
"mustBeETH": "One of the input must be ETH.",
|
||||
"enterCurrencyOrLabelCont": "Enter a {{ inputCurrency }} or {{ label }} value to continue.",
|
||||
"youAreAdding": "You are adding",
|
||||
"and": "and",
|
||||
"intoPool": "into the liquidity pool.",
|
||||
"outPool": "from the liquidity pool.",
|
||||
"youWillMint": "You will mint",
|
||||
"liquidityTokens": "liquidity tokens.",
|
||||
"totalSupplyIs": "Current total supply of liquidity tokens is",
|
||||
"youAreSettingExRate": "You are setting the initial exchange rate to",
|
||||
"totalSupplyIs0": "Current total supply of liquidity tokens is 0.",
|
||||
"tokenWorth": "At current exchange rate, each pool token is worth",
|
||||
"firstLiquidity": "You are the first person to add liquidity!",
|
||||
"initialExchangeRate": "The initial exchange rate will be set based on your deposits. Please make sure that your ETH and {{ label }} deposits have the same fiat value.",
|
||||
"removeLiquidity": "Remove Liquidity",
|
||||
"poolTokens": "Pool Tokens",
|
||||
"enterLabelCont": "Enter a {{ label }} value to continue.",
|
||||
"youAreRemoving": "You are removing between",
|
||||
"youWillRemove": "You will remove",
|
||||
"createExchange": "Create Exchange",
|
||||
"invalidTokenAddress": "Not a valid token address",
|
||||
"exchangeExists": "{{ label }} Exchange already exists!",
|
||||
"invalidSymbol": "Invalid symbol",
|
||||
"invalidDecimals": "Invalid decimals",
|
||||
"tokenAddress": "Token Address",
|
||||
"label": "Label",
|
||||
"name": "Name",
|
||||
"symbol": "Symbol",
|
||||
"decimals": "Decimals",
|
||||
"enterTokenCont": "Enter a token address to continue",
|
||||
"priceChange": "Expected price slippage",
|
||||
"forAtLeast": "for at least ",
|
||||
"brokenToken": "The selected token is not compatible with Uniswap V1. Adding liquidity will result in locked funds.",
|
||||
"toleranceExplanation": "Lowering this limit decreases your risk of frontrunning. However, this makes more likely that your transaction will fail due to normal price movements.",
|
||||
"tokenSearchPlaceholder": "Search name or paste address",
|
||||
"selectFee": "Select Fee",
|
||||
"selectLiquidityRange": "Set Price Range",
|
||||
"selectPool": "Select Fee Tier",
|
||||
"depositAmounts": "Deposit Amounts",
|
||||
"fee": "fee",
|
||||
"setLimits": "Set Limits",
|
||||
"percent": "Percent",
|
||||
"rate": "Rate",
|
||||
"currentRate": "Current {{label}} Price:",
|
||||
"inactiveRangeWarning": "Your position will not earn fees or be used in trades until the market price moves into your range.",
|
||||
"invalidRangeWarning": "Invalid range selected. The min price must be lower than the max price.",
|
||||
"connectWallet": "Connect Wallet",
|
||||
"unsupportedAsset": "Unsupported Asset",
|
||||
"feePool": "Fee Pool",
|
||||
"feeTier": "Fee Tier",
|
||||
"rebalanceMessage": "Your underlying tokens will be automatically rebalanced when the rate of the pool changes and may be different when you withdraw the position.",
|
||||
"addEarnHelper": "You will earn fees from trades proportional to your share of the pool.",
|
||||
"learnMoreAboutFess": " Learn more about earning fees.",
|
||||
"selectAPool": "Choose the best fee tier for your selected pair.",
|
||||
"poolType": "Select a fee tier based on your preferred liquidity provider fee.",
|
||||
"rangeWarning": "Your liquidity will only be active and earning fees when the rate of the pool is within this price range.",
|
||||
"chooseLiquidityAmount": "Choose an amount of tokens to open this liquidity position. If you don’t have enough tokens you can trade for them with a Swap.",
|
||||
"inputTokenDynamic": "Input {{label}}",
|
||||
"selectStartingPrice": "Set Starting Price",
|
||||
"newPoolPrice": "Select the market rate for the tokens being added."
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "No se encontró billetera de Ethereum",
|
||||
"wrongNetwork": "Te encontrás en la red equivocada",
|
||||
"switchNetwork": "Por favor cambia a {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Por favor ingresá desde un navegador móvil con web3 habilitado como Trust Wallet o Coinbase Wallet.",
|
||||
"installMetamask": "Por favor visítanos nuevamente luego de instalar Metamask en Chrome o Brave.",
|
||||
"disconnected": "Desconectado",
|
||||
"swap": "Intercambiar",
|
||||
"send": "Enviar",
|
||||
"pool": "Pool",
|
||||
"betaWarning": "Este proyecto se encuentra en beta. Usalo bajo tu propio riesgo.",
|
||||
"input": "Entrada",
|
||||
"output": "Salida",
|
||||
"estimated": "estimado",
|
||||
"balance": "Saldo: {{ balanceInput }}",
|
||||
"unlock": "Desbloquear",
|
||||
"pending": "Pendiente",
|
||||
"selectToken": "Seleccioná un token",
|
||||
"searchOrPaste": "Buscar Token o Pegar Dirección",
|
||||
"noExchange": "No se encontró la divisa",
|
||||
"exchangeRate": "Tasa de Cambio",
|
||||
"enterValueCont": "Ingresá un valor en {{ missingCurrencyValue }} para continuar.",
|
||||
"selectTokenCont": "Seleccioná un token para continuar.",
|
||||
"noLiquidity": "Sin liquidez.",
|
||||
"unlockTokenCont": "Por favor desbloqueá un token para continuar.",
|
||||
"transactionDetails": "Detalles de la transacción",
|
||||
"hideDetails": "Ocultar detalles",
|
||||
"youAreSelling": "Estás vendiendo",
|
||||
"orTransFail": "o la transacción fallará.",
|
||||
"youWillReceive": "Vas a recibir al menos",
|
||||
"youAreBuying": "Estás comprando",
|
||||
"itWillCost": "Costará a lo sumo",
|
||||
"insufficientBalance": "Saldo insuficiente",
|
||||
"inputNotValid": "No es un valor de entrada válido",
|
||||
"differentToken": "Debe ser un token distinto.",
|
||||
"noRecipient": "Ingresá una dirección de billetera para enviar.",
|
||||
"invalidRecipient": "Por favor ingrese una billetera de destino válida.",
|
||||
"recipientAddress": "Dirección del recipiente",
|
||||
"youAreSending": "Estás enviando",
|
||||
"willReceive": "recibirá al menos",
|
||||
"to": "a",
|
||||
"addLiquidity": "Agregar liquidez",
|
||||
"deposit": "Depositar",
|
||||
"currentPoolSize": "Tamaño del Pool Actual",
|
||||
"yourPoolShare": "Tu parte del Pool",
|
||||
"noZero": "El monto no puede ser cero.",
|
||||
"mustBeETH": "Una de las entradas debe ser ETH.",
|
||||
"enterCurrencyOrLabelCont": "Ingresá un valor de {{ inputCurrency }} o de {{ label }} para continuar.",
|
||||
"youAreAdding": "Estás agregando entre",
|
||||
"and": "y",
|
||||
"intoPool": "en el pool de liquidez.",
|
||||
"outPool": "en el pool de liquidez.",
|
||||
"youWillMint": "Vas a acuñar",
|
||||
"liquidityTokens": "tokens de liquidez.",
|
||||
"totalSupplyIs": "El actual suministro total de tokens de liquidez es",
|
||||
"youAreSettingExRate": "Está configurando el tipo de cambio inicial a",
|
||||
"totalSupplyIs0": "El actual suministro total de tokens de liquidez es 0.",
|
||||
"tokenWorth": "Al tipo de cambio actual, cada token del pool vale",
|
||||
"firstLiquidity": "Sos la primer persona en agregar liquidez!",
|
||||
"initialExchangeRate": "El tipo de cambio inicial se establecerá en función de tus depósitos. Por favor, asegúrate de que tus depósitos en ETH y {{ label }} tengan el mismo valor fíat.",
|
||||
"removeLiquidity": "Remover Liquidez",
|
||||
"poolTokens": "Pool de Tokens",
|
||||
"enterLabelCont": "Ingresá un valor de {{ label }} para continuar.",
|
||||
"youAreRemoving": "Estás quitando entre",
|
||||
"youWillRemove": "Vas a remover",
|
||||
"createExchange": "Crear divisa",
|
||||
"invalidTokenAddress": "No es una dirección de token válida",
|
||||
"exchangeExists": "La divisa {{ label }} ya existe!",
|
||||
"invalidSymbol": "Símbolo inválido",
|
||||
"invalidDecimals": "Decimales inválidos",
|
||||
"tokenAddress": "Dirección de Token",
|
||||
"label": "Etiqueta",
|
||||
"decimals": "Decimales",
|
||||
"enterTokenCont": "Ingresá una dirección de token para continuar"
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "No se ha encontrado billetera de Ethereum",
|
||||
"wrongNetwork": "Se encuentra en la red equivocada",
|
||||
"switchNetwork": "Por favor cambie a {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Por favor ingrese desde un navegador móvil con web3 habilitado como Trust Wallet o Coinbase Wallet.",
|
||||
"installMetamask": "Por favor visítenos nuevamente luego de instalar Metamask en Chrome o Brave.",
|
||||
"disconnected": "Desconectado",
|
||||
"swap": "Intercambiar",
|
||||
"send": "Enviar",
|
||||
"pool": "Pool",
|
||||
"betaWarning": "Este proyecto se encuentra en beta. Úselo bajo tu propio riesgo.",
|
||||
"input": "Entrada",
|
||||
"output": "Salida",
|
||||
"estimated": "estimado",
|
||||
"balance": "Saldo: {{ balanceInput }}",
|
||||
"unlock": "Desbloquear",
|
||||
"pending": "Pendiente",
|
||||
"selectToken": "Seleccione un token",
|
||||
"searchOrPaste": "Buscar Token o Pegar Dirección",
|
||||
"noExchange": "No se ha encontrado la divisa",
|
||||
"exchangeRate": "Tasa de Cambio",
|
||||
"enterValueCont": "Ingrese un valor en {{ missingCurrencyValue }} para continuar.",
|
||||
"selectTokenCont": "Seleccione un token para continuar.",
|
||||
"noLiquidity": "Sin liquidez.",
|
||||
"unlockTokenCont": "Por favor desbloquea un token para continuar.",
|
||||
"transactionDetails": "Detalles de la transacción",
|
||||
"hideDetails": "Ocultar detalles",
|
||||
"youAreSelling": "Está vendiendo",
|
||||
"orTransFail": "o la transacción fallará.",
|
||||
"youWillReceive": "Va a recibir al menos",
|
||||
"youAreBuying": "Está comprando",
|
||||
"itWillCost": "Costará a lo sumo",
|
||||
"insufficientBalance": "Saldo insuficiente",
|
||||
"inputNotValid": "No es un valor de entrada válido",
|
||||
"differentToken": "Debe ser un token distinto.",
|
||||
"noRecipient": "Ingrese una dirección de billetera para enviar.",
|
||||
"invalidRecipient": "Por favor ingrese una billetera de destino válida.",
|
||||
"recipientAddress": "Dirección del recipiente",
|
||||
"youAreSending": "Está enviando",
|
||||
"willReceive": "recibirá al menos",
|
||||
"to": "a",
|
||||
"addLiquidity": "Agregar liquidez",
|
||||
"deposit": "Depositar",
|
||||
"currentPoolSize": "Tamaño del Pool Actual",
|
||||
"yourPoolShare": "Su parte del Pool",
|
||||
"noZero": "El monto no puede ser cero.",
|
||||
"mustBeETH": "Una de las entradas debe ser ETH.",
|
||||
"enterCurrencyOrLabelCont": "Ingrese un valor de {{ inputCurrency }} o de {{ label }} para continuar.",
|
||||
"youAreAdding": "Está agregando entre",
|
||||
"and": "y",
|
||||
"intoPool": "en el pool de liquidez.",
|
||||
"outPool": "en el pool de liquidez.",
|
||||
"youWillMint": "Va a acuñar",
|
||||
"liquidityTokens": "tokens de liquidez.",
|
||||
"totalSupplyIs": "El actual suministro total de tokens de liquidez es",
|
||||
"youAreSettingExRate": "Está configurando el tipo de cambio inicial a",
|
||||
"totalSupplyIs0": "El actual suministro total de tokens de liquidez es 0.",
|
||||
"tokenWorth": "Al tipo de cambio actual, cada token del pool vale",
|
||||
"firstLiquidity": "Es la primer persona en agregar liquidez!",
|
||||
"initialExchangeRate": "El tipo de cambio inicial se establecerá en función de sus depósitos. Por favor, asegúrese de que sus depósitos en ETH y {{ label }} tengan el mismo valor fíat.",
|
||||
"removeLiquidity": "Remover Liquidez",
|
||||
"poolTokens": "Pool de Tokens",
|
||||
"enterLabelCont": "Ingresa un valor de {{ label }} para continuar.",
|
||||
"youAreRemoving": "Está quitando entre",
|
||||
"youWillRemove": "Va a remover",
|
||||
"createExchange": "Crear tipo de cambio",
|
||||
"invalidTokenAddress": "No es una dirección de token válida",
|
||||
"exchangeExists": "El tipo de cambio {{ label }} ya existe!",
|
||||
"invalidSymbol": "Símbolo inválido",
|
||||
"invalidDecimals": "Decimales inválidos",
|
||||
"tokenAddress": "Dirección de Token",
|
||||
"label": "Etiqueta",
|
||||
"decimals": "Decimales",
|
||||
"enterTokenCont": "Ingrese una dirección de token para continuar"
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
{
|
||||
"noWallet": "Wallet Ethereum non trovato",
|
||||
"wrongNetwork": "Sei connesso alla rete sbagliata",
|
||||
"switchNetwork": "Perfavore connettiti su {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Perfavore visita il sito da un browser abilitato web3 o da un app mobile come Trust Wallet o Coinbase Wallet.",
|
||||
"installMetamask": "Perfavore ritorna dopo aver installato Metamask su Chrome o Brave.",
|
||||
"disconnected": "Disconnesso",
|
||||
"swap": "Scambia",
|
||||
"swapAnyway": "Scambia comunque",
|
||||
"send": "Invia",
|
||||
"sendAnyway": "Invia comunque",
|
||||
"pool": "Riserva",
|
||||
"betaWarning": "Questo progetto è in beta. Usalo a tuo rischio.",
|
||||
"input": "Input",
|
||||
"output": "Output",
|
||||
"estimated": "stimato",
|
||||
"balance": "Saldo: {{ balanceInput }}",
|
||||
"unlock": "Sblocca",
|
||||
"pending": "In attesa",
|
||||
"selectToken": "Seleziona un token",
|
||||
"searchOrPaste": "Cerca Nome, Simbolo o Indirizzo Token",
|
||||
"searchOrPasteMobile": "Nome, Simbolo, o Indirizzo",
|
||||
"noExchange": "Nessun Exchange Trovato",
|
||||
"exchangeRate": "Tasso di cambio",
|
||||
"unknownError": "Oops! Si è verificato un Errore imprevisto. Aggiorna la pagina o visita da un altro browser o dispositivo.",
|
||||
"enterValueCont": "Inserisci un valore {{ missingCurrencyValue }} per continuare.",
|
||||
"selectTokenCont": "Seleziona un token per continuare.",
|
||||
"noLiquidity": "Nessuna liquidità.",
|
||||
"insufficientLiquidity": "Liquidità insufficiente.",
|
||||
"unlockTokenCont": "Si prega di sbloccare il token per continuare.",
|
||||
"transactionDetails": "Dettagli avanzati",
|
||||
"hideDetails": "Nascondi dettagli",
|
||||
"slippageWarning": "Avviso di scostamento",
|
||||
"highSlippageWarning": "Avviso di elevato scostamento",
|
||||
"youAreSelling": "Stai vendendo",
|
||||
"orTransFail": "o la transazione fallità.",
|
||||
"youWillReceive": "Riceverai almeno",
|
||||
"youAreBuying": "Stai comprando",
|
||||
"itWillCost": "Costerà al massimo",
|
||||
"forAtMost": "per al massimo",
|
||||
"insufficientBalance": "Saldo insufficente",
|
||||
"inputNotValid": "Non è un valore di input valido",
|
||||
"differentToken": "Deve essere un token diverso.",
|
||||
"noRecipient": "Inserisci un indirizzo di wallet a cui inviare.",
|
||||
"invalidRecipient": "Inserisci un destinatario valido per l'indirizzo del wallet.",
|
||||
"recipientAddress": "Indirizzo del destinatario",
|
||||
"youAreSending": "Stai inviando",
|
||||
"willReceive": "riceverà almeno",
|
||||
"to": "a",
|
||||
"addLiquidity": "Aggiungi liquidità",
|
||||
"deposit": "Depositare",
|
||||
"currentPoolSize": "Dimensione attuale del pool",
|
||||
"yourPoolShare": "La tua parte di pool condivisa",
|
||||
"noZero": "L'importo non può essere zero.",
|
||||
"mustBeETH": "Uno degli input deve essere ETH.",
|
||||
"enterCurrencyOrLabelCont": "Inserisci un valore {{ inputCurrency }} o {{ label }} per continuare.",
|
||||
"youAreAdding": "Stai agginugendo",
|
||||
"and": "e",
|
||||
"intoPool": "nella riserva di liquidità.",
|
||||
"outPool": "dalla riserva di liquidità.",
|
||||
"youWillMint": "Tu conierai",
|
||||
"liquidityTokens": "token di liquidità.",
|
||||
"totalSupplyIs": "L'attuale disponibilità totale di token di liquidità è",
|
||||
"youAreSettingExRate": "Stai impostando il tasso di cambio iniziale su",
|
||||
"totalSupplyIs0": "L'attuale disponibilità totale di token di liquidità è 0.",
|
||||
"tokenWorth": "Al tasso di cambio corrente, ogni token del pool vale",
|
||||
"firstLiquidity": "Sei la prima persona ad aggiungere liquidità!",
|
||||
"initialExchangeRate": "Il tasso di cambio iniziale verrà impostato in base ai tuoi depositi. Assicurati che i tuoi depositi ETH e {{ label }} abbiano lo stesso valore fiat.",
|
||||
"removeLiquidity": "Rimuovi Liquidità",
|
||||
"poolTokens": "Token Pool",
|
||||
"enterLabelCont": "Inserisci un valore {{ label }} per continuare.",
|
||||
"youAreRemoving": "Stai rimuovendo tra",
|
||||
"youWillRemove": "Rimuoverai",
|
||||
"createExchange": "Crea scambio",
|
||||
"invalidTokenAddress": "Indirizzo token non valido",
|
||||
"exchangeExists": "{{ label }} Exchange già esistente!",
|
||||
"invalidSymbol": "Simbolo non valido",
|
||||
"invalidDecimals": "Decimali non validi",
|
||||
"tokenAddress": "Indirizzo Token",
|
||||
"label": "Etichetta",
|
||||
"name": "Nome",
|
||||
"symbol": "Simbolo",
|
||||
"decimals": "Decimali",
|
||||
"enterTokenCont": "Inserire un indirizzo token per continuare",
|
||||
"priceChange": "Scostamento del prezzo previsto",
|
||||
"forAtLeast": "per almeno "
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "לא נמצא ארנק",
|
||||
"wrongNetwork": "נבחרה רשת לא נכונה",
|
||||
"switchNetwork": "{{ correctNetwork }} יש צורך לשנות את הרשת ל",
|
||||
"installWeb3MobileBrowser": "יש צורך בארנק ווב3.0, תתקין מטאמאסק או ארנק דומה",
|
||||
"installMetamask": " Metamask יש צורך להתקין תוסף מטאמאסק לדפדפן, חפשו בגוגל ",
|
||||
"disconnected": "מנותק",
|
||||
"swap": "המרה",
|
||||
"send": "שליחה",
|
||||
"pool": "להפקיד",
|
||||
"betaWarning": "הפרויקט נמצא בשלב בטא, השתמשו באחריות",
|
||||
"input": "מוכר",
|
||||
"output": "אקבל",
|
||||
"estimated": "הערכה",
|
||||
"balance": "בארנק שלי {{ balanceInput }}",
|
||||
"unlock": "שחרור נעילת ארנק",
|
||||
"pending": "ממתין לאישור",
|
||||
"selectToken": "בחרו את הטוקן להמרה",
|
||||
"searchOrPaste": "הכניסו שם או כתובת של טוקן לחיפוש",
|
||||
"noExchange": "לא מתאפשרת המרה",
|
||||
"exchangeRate": "שער המרה",
|
||||
"enterValueCont": "כדי להמשיך {{ missingCurrencyValue }} הזינו ",
|
||||
"selectTokenCont": "בחרו טוקן כדי להמשיך",
|
||||
"noLiquidity": "אין נזילות",
|
||||
"unlockTokenCont": "יש צורך לאשר את הטוקן למסחר",
|
||||
"transactionDetails": "פרטי הטרנזקציה",
|
||||
"hideDetails": "הסתר פרטים נוספים",
|
||||
"youAreSelling": "למכירה",
|
||||
"orTransFail": "או שהטרנזקציה תיכשל",
|
||||
"youWillReceive": "תוצר המרה מינימלי",
|
||||
"youAreBuying": "קונה",
|
||||
"itWillCost": "זה יעלה",
|
||||
"insufficientBalance": "אין בחשבון מספיק מטבעות",
|
||||
"inputNotValid": "קלט לא תקין",
|
||||
"differentToken": "יש צורך בטוקנים שונים",
|
||||
"noRecipient": "לא הוכנסה כתובת ארנק יעד",
|
||||
"invalidRecipient": "לא הוכנסה כתובת תקינה",
|
||||
"recipientAddress": "כתובת יעד",
|
||||
"youAreSending": "כמות לשליחה",
|
||||
"willReceive": "יתקבל לכל הפחות",
|
||||
"to": "אל",
|
||||
"addLiquidity": "להוספת נזילות למאגר",
|
||||
"deposit": "הפקדה",
|
||||
"currentPoolSize": "גודל מאגר הנזילות הכולל",
|
||||
"yourPoolShare": "חלקך במאגר הנזילות",
|
||||
"noZero": "אפס אינו ערך תקין",
|
||||
"mustBeETH": "ETH חייב להופיע באחד מהצדדים",
|
||||
"enterCurrencyOrLabelCont": "כדי להמשיך {{ inputCurrency }} או {{ label }} הכנס",
|
||||
"youAreAdding": "מתווספים למאגר",
|
||||
"and": "וגם",
|
||||
"intoPool": "לתוך הנזילות",
|
||||
"outPool": "מתוך",
|
||||
"youWillMint": "יונפקו לכם",
|
||||
"liquidityTokens": "טוקנים של נזילות",
|
||||
"totalSupplyIs": "חלקך במאגר הנזילות",
|
||||
"youAreSettingExRate": "שער ההמרה יקבע על ידך",
|
||||
"totalSupplyIs0": "אין לך טוקנים של נזילות",
|
||||
"tokenWorth": "שווי כל טוקן נזילות הינו",
|
||||
"firstLiquidity": "אתה הראשוןה שמזרים נזילות למאגר",
|
||||
"initialExchangeRate": "ושל האית'ר הינן בערך שווה {{ label }} תוודאו שההפקדה של הטוקן",
|
||||
"removeLiquidity": "הוצאה של נזילות",
|
||||
"poolTokens": "טוקנים של מאגר הנזילות",
|
||||
"enterLabelCont": "כדי להמשיך {{ label }} הכנס ",
|
||||
"youAreRemoving": "יוסרו",
|
||||
"youWillRemove": "יוסרו",
|
||||
"createExchange": "ליצירת זוג מסחר",
|
||||
"invalidTokenAddress": "כתובת טוקן לא נכונה",
|
||||
"exchangeExists": "{{ label }} כבר קיים זוג המרה עבור",
|
||||
"invalidSymbol": "תו שגוי",
|
||||
"invalidDecimals": "ספרות עשרוניות שגויות",
|
||||
"tokenAddress": "כתובת הטוקן",
|
||||
"label": "שם",
|
||||
"decimals": "ספרות עשרויות",
|
||||
"enterTokenCont": "הכניסו כתובת טוקן כדי להמשיך"
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
{
|
||||
"noWallet": "Niciun portofel Ethereum găsit",
|
||||
"wrongNetwork": "Nu ești conectat la rețeaua corectă",
|
||||
"switchNetwork": "Conectează-te te rog la {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Incearcă să vizitezi această pagina folosind un browser precum Trust Wallet sau Coinbase Wallet.",
|
||||
"installMetamask": "Vizitează această pagină din nou după ce instalezi MetaMask în Chrome sau Brave",
|
||||
"disconnected": "Deconectat",
|
||||
"swap": "Schimbă",
|
||||
"swapAnyway": "Schimbă Oricum",
|
||||
"send": "Trimite",
|
||||
"sendAnyway": "Trimite Oricum",
|
||||
"pool": "Depune Lichiditate",
|
||||
"betaWarning": "Proiectul este încă în versiunea beta. Folosește-l cu grijă, riscul este al tău.",
|
||||
"input": "Input",
|
||||
"output": "Output",
|
||||
"estimated": "estimat",
|
||||
"balance": "Balanță: {{ balanceInput }}",
|
||||
"unlock": "Deblochează",
|
||||
"pending": "În Așteptare",
|
||||
"selectToken": "Selectează un jeton",
|
||||
"searchOrPaste": "Caută după Numele, Simbolul sau Adresa Jetonului",
|
||||
"searchOrPasteMobile": "Nume, Simbol sau Adresă",
|
||||
"noExchange": "Nicio Piață de Schimb Găsită",
|
||||
"noToken": "Nicin Jeton Găsit",
|
||||
"exchangeRate": "Curs de Schimb",
|
||||
"unknownError": "Ups! A intervenit o eroare tehnică. Te rog reîncarcă pagina, sau acceseaz-o de pe alt navigator sau dispozitiv.",
|
||||
"enterValueCont": "Setează o valoare pentru {{ missingCurrencyValue }} pentru a continua.",
|
||||
"selectTokenCont": "Selectează un jeton pentru a continua.",
|
||||
"noLiquidity": "Nu Există Lichiditate.",
|
||||
"insufficientLiquidity": "Lichiditate Insuficientă.",
|
||||
"unlockTokenCont": "Te rog deblochează jetonul pentru a continua.",
|
||||
"transactionDetails": "Detalii Avansate",
|
||||
"hideDetails": "Ascunde Detaili",
|
||||
"slippageWarning": "Alertă Deviație de Preț",
|
||||
"highSlippageWarning": "Alertă Deviație de Preț Mare",
|
||||
"youAreSelling": "Tu vinzi",
|
||||
"orTransFail": "sau tranzacția va eșua.",
|
||||
"youWillReceive": "Vei primi cel puțin",
|
||||
"youAreBuying": "Tu cumperi",
|
||||
"itWillCost": "Va costa cel mult",
|
||||
"forAtMost": "pentru maximum",
|
||||
"insufficientBalance": "Balanță Insuficientă",
|
||||
"inputNotValid": "Valoarea setată nu este validă",
|
||||
"differentToken": "Trebuie să fie un jeton diferit.",
|
||||
"noRecipient": "Setează o adresă de portofel pentru destinatar.",
|
||||
"invalidRecipient": "Te rog setează o adresă de portofel validă pentru destinatar.",
|
||||
"recipientAddress": "Adresa Destinatarului",
|
||||
"youAreSending": "Tu trimiți",
|
||||
"willReceive": "vei primi cel puțin",
|
||||
"to": "spre",
|
||||
"addLiquidity": "Adaugă Lichiditate",
|
||||
"deposit": "Depozitează",
|
||||
"currentPoolSize": "Volumul Actual al Fondului",
|
||||
"yourPoolShare": "Partea Ta din Fond",
|
||||
"noZero": "Cantitatea nu poate fi zero.",
|
||||
"mustBeETH": "Una dintre valori trebuie să fie ETH.",
|
||||
"enterCurrencyOrLabelCont": "Setează o valoare pentru {{ inputCurrency }} sau {{ label }} pentru a continua. ",
|
||||
"youAreAdding": "Tu adaugi",
|
||||
"and": "și",
|
||||
"intoPool": "în fondul de lichidatate.",
|
||||
"outPool": "din fondul de lichiditate.",
|
||||
"youWillMint": "Tu vei tipări",
|
||||
"liquidityTokens": "jetoane de lichiditate.",
|
||||
"totalSupplyIs": "Cantitatea totală de jetoane de lichiditate este",
|
||||
"youAreSettingExRate": "Setezi cursul de schimb inițial la",
|
||||
"totalSupplyIs0": "Cantitatea totală de jetoane de lichiditate este 0.",
|
||||
"tokenWorth": "La cursul de schimb actual, fiecare jeton de lichiditate este valorat la",
|
||||
"firstLiquidity": "Ești prima persoană care depune lichiditate!",
|
||||
"initialExchangeRate": "Cursul de schimb inițial va fi setat în funcție de depozitele tale. Te rog asigură-te că ETH-ul și {{ label }}-ul pe care le-ai depozitat au aceeași valoare în bani fiat.",
|
||||
"removeLiquidity": "Retrage Lichiditat",
|
||||
"poolTokens": "Depune Jetoane",
|
||||
"enterLabelCont": "Setează o valoare pentru {{ label }} pentru a continua.",
|
||||
"youAreRemoving": "Retragi între",
|
||||
"youWillRemove": "Vei retrage",
|
||||
"createExchange": "Creează Piață de Schimb",
|
||||
"invalidTokenAddress": "Adresa de jeton nu este validă",
|
||||
"exchangeExists": "{{ label }} Piața de schimb există deja!",
|
||||
"invalidSymbol": "Simbol invalid",
|
||||
"invalidDecimals": "Zecimale invalide",
|
||||
"tokenAddress": "Adresă Jeton",
|
||||
"label": "Denumire",
|
||||
"name": "Nume",
|
||||
"symbol": "Simbol",
|
||||
"decimals": "Zecimale",
|
||||
"enterTokenCont": "Setează o adresă de jeton pentru a continua",
|
||||
"priceChange": "Deviație de preț așteptată",
|
||||
"forAtLeast": "pentru cel puțin ",
|
||||
"brokenToken": "Jetonul selectat nu este compatibil cu Uniswap V1. Depunerea de lichiditate îți va bloca fondurile pe vecie.",
|
||||
"toleranceExplanation": "Micșorând această limită, vei reduce riscul de frontrunning. În același timp, devine mai probabil că tranzacția va eșua din cauza variațiilor normale de preț.",
|
||||
"tokenSearchPlaceholder": "Caută nume sau lipește adresă"
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "Кошелек эфира не найден",
|
||||
"wrongNetwork": "Некорректная сеть",
|
||||
"switchNetwork": "Пожалуйста, перейдите в {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Пожалуйста, откройте в браузере с поддержкой web3, таком, как Trust Wallet или Coinbase Wallet.",
|
||||
"installMetamask": "Пожалуйста, откройте в Chrome или Brave с установленным расширением Metamask.",
|
||||
"disconnected": "Нет подключения",
|
||||
"swap": "Обменять",
|
||||
"send": "Отправить",
|
||||
"pool": "Вложить",
|
||||
"betaWarning": "Проект находится на стадии бета тестирования.",
|
||||
"input": "Ввести",
|
||||
"output": "Вывести",
|
||||
"estimated": "по оценке",
|
||||
"balance": "Баланс: {{ balanceInput }}",
|
||||
"unlock": "Разблокировать",
|
||||
"pending": "Ожидание",
|
||||
"selectToken": "Выберите токен",
|
||||
"searchOrPaste": "Поиск токена или вставить адрес токена",
|
||||
"noExchange": "Обмен не найден",
|
||||
"exchangeRate": "Курс обмена",
|
||||
"enterValueCont": "Введите {{ missingCurrencyValue }}, чтобы продолжить.",
|
||||
"selectTokenCont": "Введите токен, чтобы продолжить.",
|
||||
"noLiquidity": "Нет ликвидности.",
|
||||
"unlockTokenCont": "Пожалуйста, разблокируйте токен, чтобы продолжить.",
|
||||
"transactionDetails": "Детали транзакции",
|
||||
"hideDetails": "Скрыть подробности",
|
||||
"youAreSelling": "Вы продаете",
|
||||
"orTransFail": "или транзакция будет отклонена.",
|
||||
"youWillReceive": "Вы получите как минимум",
|
||||
"youAreBuying": "Вы покупаете",
|
||||
"itWillCost": "В крайнем случае это будет стоить",
|
||||
"insufficientBalance": "Недостаточно средств",
|
||||
"inputNotValid": "Некорректное значение",
|
||||
"differentToken": "Должны быть разные токены.",
|
||||
"noRecipient": "Введите адрес кошелька эфира, куда перечислить.",
|
||||
"invalidRecipient": "Пожалуйста, введите корректный адрес кошелька получателя.",
|
||||
"recipientAddress": "Адрес получателя",
|
||||
"youAreSending": "Вы отправляете",
|
||||
"willReceive": "получит как минимум",
|
||||
"to": "",
|
||||
"addLiquidity": "Добавить ликвидность",
|
||||
"deposit": "Вложить",
|
||||
"currentPoolSize": "Текущий размер пула",
|
||||
"yourPoolShare": "Ваша доля в пуле",
|
||||
"noZero": "Значение не может быть нулевым.",
|
||||
"mustBeETH": "Одно из значений должно быть ETH.",
|
||||
"enterCurrencyOrLabelCont": "Введите {{ inputCurrency }} или {{ label }}, чтобы продолжить.",
|
||||
"youAreAdding": "Вы добавляете от",
|
||||
"and": "и",
|
||||
"intoPool": "в пул ликвидности.",
|
||||
"outPool": "из пула ликвидности.",
|
||||
"youWillMint": "Вы произведёте",
|
||||
"liquidityTokens": "токенов ликвидности.",
|
||||
"totalSupplyIs": "Ваш объем токенов ликвидности",
|
||||
"youAreSettingExRate": "Вы устанавливаете начальный курс обмена",
|
||||
"totalSupplyIs0": "Ваш объем токенов ликвидности 0.",
|
||||
"tokenWorth": "При текущем курсе, каждый токен пула оценивается в",
|
||||
"firstLiquidity": "Вы первый, кто создаст ликвидность!",
|
||||
"initialExchangeRate": "Начальный курс обмена будет установлен согласно вашим депозитам. Убедитесь, что ваши депозиты ETH и {{ label }} имеют одинаковое значение в валюте.",
|
||||
"removeLiquidity": "Убрать ликвидность",
|
||||
"poolTokens": "Токены пула",
|
||||
"enterLabelCont": "Введите {{ label }}, чтобы продолжить.",
|
||||
"youAreRemoving": "Вы убираете в от",
|
||||
"youWillRemove": "Вы уберёте",
|
||||
"createExchange": "Создать обмен",
|
||||
"invalidTokenAddress": "Некорректный адрес токена",
|
||||
"exchangeExists": "{{ label }} Обмен уже существует!",
|
||||
"invalidSymbol": "Некорректный символ",
|
||||
"invalidDecimals": "Некорректное десятичное значение",
|
||||
"tokenAddress": "Адрес токена",
|
||||
"label": "Название",
|
||||
"decimals": "Десятичное значение",
|
||||
"enterTokenCont": "Чтобы продолжить, введите адрес токена"
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
{
|
||||
"noWallet": "Không tìm thấy ví tiền Ethereum",
|
||||
"wrongNetwork": "Kết nối mạng không đúng",
|
||||
"switchNetwork": "Vui lòng chuyển sang {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "Vui lòng truy cập từ trình duyệt di động hỗ trợ web3 như là Ví Trust hoặc Ví Coinbase",
|
||||
"installMetamask": "Vui lòng truy cập sau khi cài đặt Metamask trên Chrome hoặc Brave.",
|
||||
"disconnected": "Ngắt kết nối rồi",
|
||||
"swap": "Hoán đổi",
|
||||
"swapAnyway": "Tiếp tục hoán đổi?",
|
||||
"send": "Gửi",
|
||||
"sendAnyway": "Tiếp tục gửi?",
|
||||
"pool": "Chung vốn",
|
||||
"betaWarning": "Dự án này đang trong giai đoạn thử nghiệm. Sử dụng có rủi ro của riêng bạn",
|
||||
"input": "Đầu vào",
|
||||
"output": "Đầu ra",
|
||||
"estimated": "ước lượng",
|
||||
"balance": "Số dư: {{ balanceInput }}",
|
||||
"unlock": "Mở khóa",
|
||||
"pending": "Đang chờ xử lý",
|
||||
"selectToken": "Chọn một đồng tiền ảo",
|
||||
"searchOrPaste": "Tìm kiếm tên, biểu tượng, hoặc địa chỉ của đồng tiền ảo",
|
||||
"searchOrPasteMobile": "Tên, Biểu tượng, hoặc Địa chỉ",
|
||||
"noExchange": "Không tìm thấy giao dịch",
|
||||
"exchangeRate": "Tỷ giá",
|
||||
"unknownError": "Rất tiếc! Xảy ra lỗi không xác định. Vui lòng làm mới trang, hoặc truy cập từ trình duyệt hay thiết bị khác.",
|
||||
"enterValueCont": "Nhập một giá trị {{ missingCurrencyValue }} để tiếp tục.",
|
||||
"selectTokenCont": "Chọn một đồng tiền ảo để tiếp tục.",
|
||||
"noLiquidity": "Không có tính thanh khoản.",
|
||||
"insufficientLiquidity": "Không đủ tính thanh khoản.",
|
||||
"unlockTokenCont": "Vui lòng mở khoá đồng tiền ảo để tiếp tục",
|
||||
"transactionDetails": "Chi tiết nâng cao",
|
||||
"hideDetails": "Ẩn chi tiết",
|
||||
"slippageWarning": "Cảnh báo trượt giá",
|
||||
"highSlippageWarning": "Cảnh báo trượt giá cao",
|
||||
"youAreSelling": "Bạn đang bán",
|
||||
"orTransFail": "hoặc giao dịch sẽ thất bại.",
|
||||
"youWillReceive": "Bạn sẽ nhận dược ít nhất là",
|
||||
"youAreBuying": "Bạn đang mua",
|
||||
"itWillCost": "Nó sẽ có giá cao nhất",
|
||||
"forAtMost": "nhiều nhất",
|
||||
"insufficientBalance": "Số dư không đủ",
|
||||
"inputNotValid": "Giá trị nhập vào không hợp lệ",
|
||||
"differentToken": "Đồng tiền ảo phải khác nhau.",
|
||||
"noRecipient": "Nhập địa chỉ ví để gửi đến.",
|
||||
"invalidRecipient": "Vui lòng nhập một người nhận địa chỉ ví hợp lệ.",
|
||||
"recipientAddress": "Địa chỉ người nhận",
|
||||
"youAreSending": "Bạn đang gửi",
|
||||
"willReceive": "sẽ nhận dược ít nhất là",
|
||||
"to": "đến",
|
||||
"addLiquidity": "Thêm tiền thanh khoản",
|
||||
"deposit": "Gửi tiền",
|
||||
"currentPoolSize": "Quy mô hiện tại của quỹ",
|
||||
"yourPoolShare": "Phần hùn của bạn trong quỹ",
|
||||
"noZero": "Số tiền không thể bằng không.",
|
||||
"mustBeETH": "Một trong những đầu vào phải là ETH.",
|
||||
"enterCurrencyOrLabelCont": "Nhập giá trị {{ inputCurrency }} hoặc {{ label }} để tiếp tục.",
|
||||
"youAreAdding": "Bạn đang thêm",
|
||||
"and": "và",
|
||||
"intoPool": "vào nhóm thanh khoản.",
|
||||
"outPool": "từ nhóm thanh khoản.",
|
||||
"youWillMint": "Bạn sẽ đúc tiền",
|
||||
"liquidityTokens": "đồng thanh khoản.",
|
||||
"totalSupplyIs": "Tổng cung hiện tại của đồng thanh khoản là",
|
||||
"youAreSettingExRate": "Bạn đang đặt tỷ giá hối đoái ban đầu thành",
|
||||
"totalSupplyIs0": "Tổng cung hiện tại của đồng thanh khoản là 0.",
|
||||
"tokenWorth": "Tại tỷ giá hối đoái hiện tại, giá trị đồng token của quỹ là",
|
||||
"firstLiquidity": "Bạn là người đầu tiên thêm thanh khoản!",
|
||||
"initialExchangeRate": "Tỷ giá hối đoái ban đầu sẽ được thiết lập dựa trên tiền gửi của bạn. Vui lòng đảm bảo rằng tiền gửi ETH và {{ label }} của bạn có cùng giá trị tiền định danh.",
|
||||
"removeLiquidity": "Loại bỏ thanh khoản",
|
||||
"poolTokens": "Đồng tiền ảo của quỹ",
|
||||
"enterLabelCont": "Nhập giá trị {{ label }} để tiếp tục",
|
||||
"youAreRemoving": "Bạn đang loại bỏ giữa",
|
||||
"youWillRemove": "Bạn sẽ loại bỏ",
|
||||
"createExchange": "Tạo giao dịch",
|
||||
"invalidTokenAddress": "Địa chỉ đồng tiền điện tử không hợp lệ",
|
||||
"exchangeExists": "{{ label }} Giao dịch đã tồn tại!",
|
||||
"invalidSymbol": "Biểu tượng không hợp lệ",
|
||||
"invalidDecimals": "Số thập phân không hợp lệ",
|
||||
"tokenAddress": "Địa chỉ đồng tiền điện tử",
|
||||
"label": "Nhãn",
|
||||
"name": "Tên",
|
||||
"symbol": "Biểu tượng",
|
||||
"decimals": "Số thập phân",
|
||||
"enterTokenCont": "Nhập địa chỉ đồng tiền ảo để tiếp tục",
|
||||
"priceChange": "Trượt giá dự kiến",
|
||||
"forAtLeast": "cho ít nhất "
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "未发现以太钱包",
|
||||
"wrongNetwork": "网络错误",
|
||||
"switchNetwork": "请切换到 {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "请从支持web3的移动端浏览器,如 Trust Wallet 或 Coinbase Wallet 访问。",
|
||||
"installMetamask": "请从安装了 Metamask 插件的 Chrome 或 Brave 访问。",
|
||||
"disconnected": "未连接",
|
||||
"swap": "兑换",
|
||||
"send": "发送",
|
||||
"pool": "资金池",
|
||||
"betaWarning": "项目尚处于beta阶段。使用需自行承担风险。",
|
||||
"input": "输入",
|
||||
"output": "输出",
|
||||
"estimated": "估计",
|
||||
"balance": "余额: {{ balanceInput }}",
|
||||
"unlock": "解锁",
|
||||
"pending": "处理中",
|
||||
"selectToken": "选择通证",
|
||||
"searchOrPaste": "搜索通证或粘贴地址",
|
||||
"noExchange": "未找到交易所",
|
||||
"exchangeRate": "兑换率",
|
||||
"enterValueCont": "输入{{ missingCurrencyValue }}值并继续。",
|
||||
"selectTokenCont": "选取通证继续。",
|
||||
"noLiquidity": "没有流动金。",
|
||||
"unlockTokenCont": "请解锁通证并继续。",
|
||||
"transactionDetails": "交易明细",
|
||||
"hideDetails": "隐藏明细",
|
||||
"youAreSelling": "你正在出售",
|
||||
"orTransFail": "或交易失败。",
|
||||
"youWillReceive": "你将至少收到",
|
||||
"youAreBuying": "你正在购买",
|
||||
"itWillCost": "它将至少花费",
|
||||
"insufficientBalance": "余额不足",
|
||||
"inputNotValid": "无效的输入值",
|
||||
"differentToken": "必须是不同的通证。",
|
||||
"noRecipient": "输入接收钱包地址。",
|
||||
"invalidRecipient": "请输入有效的收钱地址。",
|
||||
"recipientAddress": "接收地址",
|
||||
"youAreSending": "你正在发送",
|
||||
"willReceive": "将至少收到",
|
||||
"to": "至",
|
||||
"addLiquidity": "添加流动金",
|
||||
"deposit": "存入",
|
||||
"currentPoolSize": "当前资金池大小",
|
||||
"yourPoolShare": "你的资金池份额",
|
||||
"noZero": "金额不能为零。",
|
||||
"mustBeETH": "输入中必须有一个是 ETH。",
|
||||
"enterCurrencyOrLabelCont": "输入 {{ inputCurrency }} 或 {{ label }} 值并继续。",
|
||||
"youAreAdding": "你将添加",
|
||||
"and": "和",
|
||||
"intoPool": "入流动资金池。",
|
||||
"outPool": "出流动资金池。",
|
||||
"youWillMint": "你将铸造",
|
||||
"liquidityTokens": "流动通证。",
|
||||
"totalSupplyIs": "当前流动通证的总量是",
|
||||
"youAreSettingExRate": "你将初始兑换率设置为",
|
||||
"totalSupplyIs0": "当前流动通证的总量是0。",
|
||||
"tokenWorth": "当前兑换率下,每个资金池通证价值",
|
||||
"firstLiquidity": "你是第一个添加流动金的人!",
|
||||
"initialExchangeRate": "初始兑换率将由你的存入情况决定。请确保你存入的 ETH 和 {{ label }} 具有相同的总市值。",
|
||||
"removeLiquidity": "删除流动金",
|
||||
"poolTokens": "资金池通证",
|
||||
"enterLabelCont": "输入 {{ label }} 值并继续。",
|
||||
"youAreRemoving": "你正在移除",
|
||||
"youWillRemove": "你将移除",
|
||||
"createExchange": "创建交易所",
|
||||
"invalidTokenAddress": "通证地址无效",
|
||||
"exchangeExists": "{{ label }} 交易所已存在!",
|
||||
"invalidSymbol": "通证符号无效",
|
||||
"invalidDecimals": "小数位数无效",
|
||||
"tokenAddress": "通证地址",
|
||||
"label": "通证符号",
|
||||
"decimals": "小数位数",
|
||||
"enterTokenCont": "输入通证地址并继续"
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"noWallet": "未偵測到以太坊錢包",
|
||||
"wrongNetwork": "你位在錯誤的網路",
|
||||
"switchNetwork": "請切換到 {{ correctNetwork }}",
|
||||
"installWeb3MobileBrowser": "請安裝含有 web3 瀏覽器的手機錢包,如 Trust Wallet 或 Coinbase Wallet。",
|
||||
"installMetamask": "請使用 Chrome 或 Brave 瀏覽器安裝 Metamask。",
|
||||
"disconnected": "未連接",
|
||||
"swap": "兌換",
|
||||
"send": "發送",
|
||||
"pool": "資金池",
|
||||
"betaWarning": "本產品仍在測試階段。使用者需自負風險。",
|
||||
"input": "輸入",
|
||||
"output": "輸出",
|
||||
"estimated": "估計",
|
||||
"balance": "餘額: {{ balanceInput }}",
|
||||
"unlock": "解鎖",
|
||||
"pending": "處理中",
|
||||
"selectToken": "選擇代幣",
|
||||
"searchOrPaste": "選擇代幣或輸入地址",
|
||||
"noExchange": "找不到交易所",
|
||||
"exchangeRate": "匯率",
|
||||
"enterValueCont": "輸入 {{ missingCurrencyValue }} 以繼續。",
|
||||
"selectTokenCont": "選擇代幣以繼續。",
|
||||
"noLiquidity": "沒有流動性資金。",
|
||||
"unlockTokenCont": "解鎖代幣以繼續。",
|
||||
"transactionDetails": "交易明細",
|
||||
"hideDetails": "隱藏明細",
|
||||
"youAreSelling": "你正在出售",
|
||||
"orTransFail": "或交易失敗。",
|
||||
"youWillReceive": "你將至少收到",
|
||||
"youAreBuying": "你正在購買",
|
||||
"itWillCost": "這將花費至多",
|
||||
"insufficientBalance": "餘額不足",
|
||||
"inputNotValid": "無效的輸入值",
|
||||
"differentToken": "必須是不同的代幣。",
|
||||
"noRecipient": "請輸入收款人錢包地址。",
|
||||
"invalidRecipient": "請輸入有效的錢包地址。",
|
||||
"recipientAddress": "收款人錢包地址",
|
||||
"youAreSending": "你正在發送",
|
||||
"willReceive": "將至少收到",
|
||||
"to": "至",
|
||||
"addLiquidity": "增加流動性資金",
|
||||
"deposit": "存入",
|
||||
"currentPoolSize": "目前的資金池總量",
|
||||
"yourPoolShare": "你在資金池中的佔比",
|
||||
"noZero": "金額不能為零。",
|
||||
"mustBeETH": "輸入中必須包含 ETH。",
|
||||
"enterCurrencyOrLabelCont": "輸入 {{ inputCurrency }} 或 {{ label }} 以繼續。",
|
||||
"youAreAdding": "你將把",
|
||||
"and": "和",
|
||||
"intoPool": "加入資金池。",
|
||||
"outPool": "領出資金池。",
|
||||
"youWillMint": "你將產生",
|
||||
"liquidityTokens": "流動性代幣。",
|
||||
"totalSupplyIs": "目前流動性代幣供給總量為",
|
||||
"youAreSettingExRate": "初始的匯率將被設定為",
|
||||
"totalSupplyIs0": "目前流動性代幣供給為零。",
|
||||
"tokenWorth": "依據目前的匯率,每個流動性代幣價值",
|
||||
"firstLiquidity": "您是第一個提供流動性資金的人!",
|
||||
"initialExchangeRate": "初始的匯率將取決於你存入的資金。請確保存入的 ETH 和 {{ label }} 的價值相等。",
|
||||
"removeLiquidity": "領出流動性資金",
|
||||
"poolTokens": "資金池代幣",
|
||||
"enterLabelCont": "輸入 {{ label }} 以繼續。",
|
||||
"youAreRemoving": "您正在移除",
|
||||
"youWillRemove": "您即將移除",
|
||||
"createExchange": "創建交易所",
|
||||
"invalidTokenAddress": "無效的代幣地址",
|
||||
"exchangeExists": "{{ label }} 的交易所已經存在!",
|
||||
"invalidSymbol": "代幣符號錯誤",
|
||||
"invalidDecimals": "小數位數錯誤",
|
||||
"tokenAddress": "代幣地址",
|
||||
"label": "代幣符號",
|
||||
"decimals": "小數位數",
|
||||
"enterTokenCont": "輸入代幣地址"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 883 KiB After Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 670 KiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 413 KiB |
@@ -4,6 +4,7 @@ import useCopyClipboard from '../../hooks/useCopyClipboard'
|
||||
|
||||
import { LinkStyledButton } from '../../theme'
|
||||
import { CheckCircle, Copy } from 'react-feather'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const CopyIcon = styled(LinkStyledButton)`
|
||||
color: ${({ theme }) => theme.text3};
|
||||
@@ -33,7 +34,9 @@ export default function CopyHelper(props: { toCopy: string; children?: React.Rea
|
||||
{isCopied ? (
|
||||
<TransactionStatusText>
|
||||
<CheckCircle size={'16'} />
|
||||
<TransactionStatusText>Copied</TransactionStatusText>
|
||||
<TransactionStatusText>
|
||||
<Trans>Copied</Trans>
|
||||
</TransactionStatusText>
|
||||
</TransactionStatusText>
|
||||
) : (
|
||||
<TransactionStatusText>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import React, { useCallback, useContext } from 'react'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import styled, { ThemeContext } from 'styled-components'
|
||||
import { SUPPORTED_WALLETS } from '../../constants/wallet'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { AppDispatch } from '../../state'
|
||||
import { clearAllTransactions } from '../../state/transactions/actions'
|
||||
import { shortenAddress } from '../../utils'
|
||||
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
|
||||
@@ -21,6 +19,8 @@ import Identicon from '../Identicon'
|
||||
import { ButtonSecondary } from '../Button'
|
||||
import { ExternalLink as LinkIcon } from 'react-feather'
|
||||
import { ExternalLink, LinkStyledButton, TYPE } from '../../theme'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { useAppDispatch } from 'state/hooks'
|
||||
|
||||
const HeaderRow = styled.div`
|
||||
${({ theme }) => theme.flexRowNoWrap};
|
||||
@@ -226,7 +226,7 @@ export default function AccountDetails({
|
||||
}: AccountDetailsProps) {
|
||||
const { chainId, account, connector } = useActiveWeb3React()
|
||||
const theme = useContext(ThemeContext)
|
||||
const dispatch = useDispatch<AppDispatch>()
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
function formatConnectorName() {
|
||||
const { ethereum } = window
|
||||
@@ -237,7 +237,11 @@ export default function AccountDetails({
|
||||
SUPPORTED_WALLETS[k].connector === connector && (connector !== injected || isMetaMask === (k === 'METAMASK'))
|
||||
)
|
||||
.map((k) => SUPPORTED_WALLETS[k].name)[0]
|
||||
return <WalletName>Connected with {name}</WalletName>
|
||||
return (
|
||||
<WalletName>
|
||||
<Trans>Connected with {name}</Trans>
|
||||
</WalletName>
|
||||
)
|
||||
}
|
||||
|
||||
function getStatusIcon() {
|
||||
@@ -250,32 +254,32 @@ export default function AccountDetails({
|
||||
} else if (connector === walletconnect) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={WalletConnectIcon} alt={'wallet connect logo'} />
|
||||
<img src={WalletConnectIcon} alt={'WalletConnect logo'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === walletlink) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={CoinbaseWalletIcon} alt={'coinbase wallet logo'} />
|
||||
<img src={CoinbaseWalletIcon} alt={'Coinbase Wallet logo'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === fortmatic) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={FortmaticIcon} alt={'fortmatic logo'} />
|
||||
<img src={FortmaticIcon} alt={'Fortmatic logo'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === portis) {
|
||||
return (
|
||||
<>
|
||||
<IconWrapper size={16}>
|
||||
<img src={PortisIcon} alt={'portis logo'} />
|
||||
<img src={PortisIcon} alt={'Portis logo'} />
|
||||
<MainWalletAction
|
||||
onClick={() => {
|
||||
portis.portis.showPortis()
|
||||
}}
|
||||
>
|
||||
Show Portis
|
||||
<Trans>Show Portis</Trans>
|
||||
</MainWalletAction>
|
||||
</IconWrapper>
|
||||
</>
|
||||
@@ -294,7 +298,9 @@ export default function AccountDetails({
|
||||
<CloseIcon onClick={toggleWalletModal}>
|
||||
<CloseColor />
|
||||
</CloseIcon>
|
||||
<HeaderRow>Account</HeaderRow>
|
||||
<HeaderRow>
|
||||
<Trans>Account</Trans>
|
||||
</HeaderRow>
|
||||
<AccountSection>
|
||||
<YourAccount>
|
||||
<InfoCard>
|
||||
@@ -308,7 +314,7 @@ export default function AccountDetails({
|
||||
;(connector as any).close()
|
||||
}}
|
||||
>
|
||||
Disconnect
|
||||
<Trans>Disconnect</Trans>
|
||||
</WalletAction>
|
||||
)}
|
||||
<WalletAction
|
||||
@@ -317,7 +323,7 @@ export default function AccountDetails({
|
||||
openOptions()
|
||||
}}
|
||||
>
|
||||
Change
|
||||
<Trans>Change</Trans>
|
||||
</WalletAction>
|
||||
</div>
|
||||
</AccountGroupingRow>
|
||||
@@ -347,7 +353,9 @@ export default function AccountDetails({
|
||||
<div>
|
||||
{account && (
|
||||
<Copy toCopy={account}>
|
||||
<span style={{ marginLeft: '4px' }}>Copy Address</span>
|
||||
<span style={{ marginLeft: '4px' }}>
|
||||
<Trans>Copy Address</Trans>
|
||||
</span>
|
||||
</Copy>
|
||||
)}
|
||||
{chainId && account && (
|
||||
@@ -357,7 +365,9 @@ export default function AccountDetails({
|
||||
href={getExplorerLink(chainId, ENSName, ExplorerDataType.ADDRESS)}
|
||||
>
|
||||
<LinkIcon size={16} />
|
||||
<span style={{ marginLeft: '4px' }}>View on Etherscan</span>
|
||||
<span style={{ marginLeft: '4px' }}>
|
||||
<Trans>View on Explorer</Trans>
|
||||
</span>
|
||||
</AddressLink>
|
||||
)}
|
||||
</div>
|
||||
@@ -369,7 +379,9 @@ export default function AccountDetails({
|
||||
<div>
|
||||
{account && (
|
||||
<Copy toCopy={account}>
|
||||
<span style={{ marginLeft: '4px' }}>Copy Address</span>
|
||||
<span style={{ marginLeft: '4px' }}>
|
||||
<Trans>Copy Address</Trans>
|
||||
</span>
|
||||
</Copy>
|
||||
)}
|
||||
{chainId && account && (
|
||||
@@ -379,7 +391,9 @@ export default function AccountDetails({
|
||||
href={getExplorerLink(chainId, account, ExplorerDataType.ADDRESS)}
|
||||
>
|
||||
<LinkIcon size={16} />
|
||||
<span style={{ marginLeft: '4px' }}>View on Etherscan</span>
|
||||
<span style={{ marginLeft: '4px' }}>
|
||||
<Trans>View on Explorer</Trans>
|
||||
</span>
|
||||
</AddressLink>
|
||||
)}
|
||||
</div>
|
||||
@@ -394,15 +408,21 @@ export default function AccountDetails({
|
||||
{!!pendingTransactions.length || !!confirmedTransactions.length ? (
|
||||
<LowerSection>
|
||||
<AutoRow mb={'1rem'} style={{ justifyContent: 'space-between' }}>
|
||||
<TYPE.body>Recent Transactions</TYPE.body>
|
||||
<LinkStyledButton onClick={clearAllTransactionsCallback}>(clear all)</LinkStyledButton>
|
||||
<TYPE.body>
|
||||
<Trans>Recent Transactions</Trans>
|
||||
</TYPE.body>
|
||||
<LinkStyledButton onClick={clearAllTransactionsCallback}>
|
||||
<Trans>(clear all)</Trans>
|
||||
</LinkStyledButton>
|
||||
</AutoRow>
|
||||
{renderTransactions(pendingTransactions)}
|
||||
{renderTransactions(confirmedTransactions)}
|
||||
</LowerSection>
|
||||
) : (
|
||||
<LowerSection>
|
||||
<TYPE.body color={theme.text1}>Your transactions will appear here...</TYPE.body>
|
||||
<TYPE.body color={theme.text1}>
|
||||
<Trans>Your transactions will appear here...</Trans>
|
||||
</TYPE.body>
|
||||
</LowerSection>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -106,7 +106,7 @@ export default function AddressInputPanel({
|
||||
href={getExplorerLink(chainId, name ?? address, ExplorerDataType.ADDRESS)}
|
||||
style={{ fontSize: '14px' }}
|
||||
>
|
||||
(View on Etherscan)
|
||||
(View on Explorer)
|
||||
</ExternalLink>
|
||||
)}
|
||||
</RowBetween>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import React, { PropsWithChildren } from 'react'
|
||||
import Component, { BadgeProps, BadgeVariant } from './index'
|
||||
|
||||
export default {
|
||||
title: 'Badge',
|
||||
argTypes: {
|
||||
variant: {
|
||||
name: 'variant',
|
||||
type: { name: 'string', require: false },
|
||||
defaultValue: BadgeVariant.DEFAULT,
|
||||
description: 'badge variant',
|
||||
control: {
|
||||
type: 'select',
|
||||
options: Object.values(BadgeVariant),
|
||||
},
|
||||
},
|
||||
},
|
||||
args: {
|
||||
children: '🦄 UNISWAP 🦄',
|
||||
},
|
||||
}
|
||||
|
||||
const Template: Story<PropsWithChildren<BadgeProps>> = (args) => <Component {...args}>{args.children}</Component>
|
||||
|
||||
export const DefaultBadge = Template.bind({})
|
||||
DefaultBadge.args = {
|
||||
variant: BadgeVariant.DEFAULT,
|
||||
}
|
||||
|
||||
export const WarningBadge = Template.bind({})
|
||||
WarningBadge.args = {
|
||||
variant: BadgeVariant.WARNING,
|
||||
}
|
||||
|
||||
export const NegativeBadge = Template.bind({})
|
||||
NegativeBadge.args = {
|
||||
variant: BadgeVariant.NEGATIVE,
|
||||
}
|
||||
|
||||
export const PositiveBadge = Template.bind({})
|
||||
PositiveBadge.args = {
|
||||
variant: BadgeVariant.POSITIVE,
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import Badge, { BadgeVariant } from 'components/Badge'
|
||||
import styled from 'styled-components/macro'
|
||||
|
||||
import { MouseoverTooltip } from '../../components/Tooltip'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { AlertCircle } from 'react-feather'
|
||||
|
||||
const BadgeWrapper = styled.div`
|
||||
@@ -40,35 +40,47 @@ export default function RangeBadge({
|
||||
removed: boolean | undefined
|
||||
inRange: boolean | undefined
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<BadgeWrapper>
|
||||
{removed ? (
|
||||
<MouseoverTooltip text={`Your position has 0 liquidity, and is not earning fees.`}>
|
||||
<MouseoverTooltip text={<Trans>Your position has 0 liquidity, and is not earning fees.</Trans>}>
|
||||
<Badge variant={BadgeVariant.DEFAULT}>
|
||||
<AlertCircle width={14} height={14} />
|
||||
|
||||
<BadgeText>{t('Inactive')}</BadgeText>
|
||||
<BadgeText>
|
||||
<Trans>Closed</Trans>
|
||||
</BadgeText>
|
||||
</Badge>
|
||||
</MouseoverTooltip>
|
||||
) : inRange ? (
|
||||
<MouseoverTooltip
|
||||
text={`The price of this pool is within your selected range. Your position is currently earning fees.`}
|
||||
text={
|
||||
<Trans>
|
||||
The price of this pool is within your selected range. Your position is currently earning fees.
|
||||
</Trans>
|
||||
}
|
||||
>
|
||||
<Badge variant={BadgeVariant.DEFAULT}>
|
||||
<ActiveDot />
|
||||
<BadgeText>{t('In range')}</BadgeText>
|
||||
<BadgeText>
|
||||
<Trans>In range</Trans>
|
||||
</BadgeText>
|
||||
</Badge>
|
||||
</MouseoverTooltip>
|
||||
) : (
|
||||
<MouseoverTooltip
|
||||
text={`The price of this pool is outside of your selected range. Your position is not currently earning fees.`}
|
||||
text={
|
||||
<Trans>
|
||||
The price of this pool is outside of your selected range. Your position is not currently earning fees.
|
||||
</Trans>
|
||||
}
|
||||
>
|
||||
<Badge variant={BadgeVariant.WARNING}>
|
||||
<AlertCircle width={14} height={14} />
|
||||
|
||||
<BadgeText>{t('Out of range')}</BadgeText>
|
||||
<BadgeText>
|
||||
<Trans>Out of range</Trans>
|
||||
</BadgeText>
|
||||
</Badge>
|
||||
</MouseoverTooltip>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { ReactNode, useMemo } from 'react'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
// SDN OFAC addresses
|
||||
const BLOCKED_ADDRESSES: string[] = [
|
||||
@@ -14,7 +15,11 @@ export default function Blocklist({ children }: { children: ReactNode }) {
|
||||
const { account } = useActiveWeb3React()
|
||||
const blocked: boolean = useMemo(() => Boolean(account && BLOCKED_ADDRESSES.indexOf(account) !== -1), [account])
|
||||
if (blocked) {
|
||||
return <div>Blocked address</div>
|
||||
return (
|
||||
<div>
|
||||
<Trans>Blocked address</Trans>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return <>{children}</>
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import styled from 'styled-components/macro'
|
||||
import React from 'react'
|
||||
import {
|
||||
ButtonConfirmed,
|
||||
ButtonDropdown,
|
||||
ButtonDropdownGrey,
|
||||
ButtonDropdownLight,
|
||||
ButtonEmpty,
|
||||
ButtonError,
|
||||
ButtonGray,
|
||||
ButtonLight,
|
||||
ButtonOutlined,
|
||||
ButtonPink,
|
||||
ButtonPrimary,
|
||||
ButtonRadio,
|
||||
ButtonSecondary,
|
||||
ButtonUNIGradient,
|
||||
ButtonWhite,
|
||||
} from './index'
|
||||
|
||||
const wrapperCss = styled.main`
|
||||
font-size: 2em;
|
||||
margin: 3em;
|
||||
max-width: 300px;
|
||||
`
|
||||
|
||||
export default {
|
||||
title: 'Buttons',
|
||||
argTypes: {
|
||||
disabled: { control: { type: 'boolean' } },
|
||||
onClick: { action: 'clicked' },
|
||||
},
|
||||
decorators: [
|
||||
(Component: Story) => (
|
||||
<div css={wrapperCss}>
|
||||
<Component />
|
||||
</div>
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
const Unicorn = () => (
|
||||
<span role="img" aria-label="unicorn">
|
||||
🦄
|
||||
</span>
|
||||
)
|
||||
|
||||
export const Radio = () => (
|
||||
<ButtonRadio>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonRadio>
|
||||
)
|
||||
export const DropdownLight = () => (
|
||||
<ButtonDropdownLight>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonDropdownLight>
|
||||
)
|
||||
export const DropdownGrey = () => (
|
||||
<ButtonDropdownGrey>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonDropdownGrey>
|
||||
)
|
||||
export const Dropdown = () => (
|
||||
<ButtonDropdown>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonDropdown>
|
||||
)
|
||||
export const Error = () => (
|
||||
<ButtonError>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonError>
|
||||
)
|
||||
export const Confirmed = () => (
|
||||
<ButtonConfirmed>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonConfirmed>
|
||||
)
|
||||
export const White = () => (
|
||||
<ButtonWhite>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonWhite>
|
||||
)
|
||||
export const Empty = () => (
|
||||
<ButtonEmpty>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonEmpty>
|
||||
)
|
||||
export const Outlined = () => (
|
||||
<ButtonOutlined>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonOutlined>
|
||||
)
|
||||
export const UNIGradient = () => (
|
||||
<ButtonUNIGradient>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonUNIGradient>
|
||||
)
|
||||
export const Pink = () => (
|
||||
<ButtonPink>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonPink>
|
||||
)
|
||||
export const Secondary = () => (
|
||||
<ButtonSecondary>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonSecondary>
|
||||
)
|
||||
export const Gray = () => (
|
||||
<ButtonGray>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonGray>
|
||||
)
|
||||
export const Light = () => (
|
||||
<ButtonLight>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonLight>
|
||||
)
|
||||
export const Primary = () => (
|
||||
<ButtonPrimary>
|
||||
<Unicorn />
|
||||
UNISWAP
|
||||
<Unicorn />
|
||||
</ButtonPrimary>
|
||||
)
|
||||
@@ -4,15 +4,19 @@ import { darken } from 'polished'
|
||||
|
||||
import { RowBetween } from '../Row'
|
||||
import { ChevronDown, Check } from 'react-feather'
|
||||
import { Button as RebassButton, ButtonProps } from 'rebass/styled-components'
|
||||
import { Button as RebassButton, ButtonProps as ButtonPropsOriginal } from 'rebass/styled-components'
|
||||
import useTheme from 'hooks/useTheme'
|
||||
|
||||
const Base = styled(RebassButton)<{
|
||||
padding?: string
|
||||
width?: string
|
||||
borderRadius?: string
|
||||
altDisabledStyle?: boolean
|
||||
}>`
|
||||
type ButtonProps = Omit<ButtonPropsOriginal, 'css'>
|
||||
|
||||
const Base = styled(RebassButton)<
|
||||
{
|
||||
padding?: string
|
||||
width?: string
|
||||
borderRadius?: string
|
||||
altDisabledStyle?: boolean
|
||||
} & ButtonProps
|
||||
>`
|
||||
padding: ${({ padding }) => (padding ? padding : '16px')};
|
||||
width: ${({ width }) => (width ? width : '100%')};
|
||||
font-weight: 500;
|
||||
|
||||
@@ -4,6 +4,7 @@ import useTheme from '../../hooks/useTheme'
|
||||
import { TYPE } from '../../theme'
|
||||
import { warningSeverity } from '../../utils/prices'
|
||||
import HoverInlineText from 'components/HoverInlineText'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
export function FiatValue({
|
||||
fiatValue,
|
||||
@@ -24,10 +25,18 @@ export function FiatValue({
|
||||
|
||||
return (
|
||||
<TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>
|
||||
{fiatValue ? '~$' : ''}
|
||||
<HoverInlineText text={fiatValue ? fiatValue?.toSignificant(6, { groupSeparator: ',' }) : ''} />{' '}
|
||||
{fiatValue ? (
|
||||
<Trans>
|
||||
~$ <HoverInlineText text={fiatValue?.toSignificant(6, { groupSeparator: ',' })} />
|
||||
</Trans>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{priceImpact ? (
|
||||
<span style={{ color: priceImpactColor }}> ({priceImpact.multiply(-1).toSignificant(3)}%)</span>
|
||||
<span style={{ color: priceImpactColor }}>
|
||||
{' '}
|
||||
(<Trans>{priceImpact.multiply(-1).toSignificant(3)}%</Trans>)
|
||||
</span>
|
||||
) : null}
|
||||
</TYPE.body>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Pair } from '@uniswap/v2-sdk'
|
||||
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
|
||||
import React, { useState, useCallback } from 'react'
|
||||
import React, { useState, useCallback, ReactNode } from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import { darken } from 'polished'
|
||||
import { useCurrencyBalance } from '../../state/wallet/hooks'
|
||||
@@ -13,12 +13,12 @@ import { TYPE } from '../../theme'
|
||||
import { Input as NumericalInput } from '../NumericalInput'
|
||||
import { ReactComponent as DropDown } from '../../assets/images/dropdown.svg'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import useTheme from '../../hooks/useTheme'
|
||||
import { Lock } from 'react-feather'
|
||||
import { AutoColumn } from 'components/Column'
|
||||
import { FiatValue } from './FiatValue'
|
||||
import { formatTokenAmount } from 'utils/formatTokenAmount'
|
||||
import { formatCurrencyAmount } from 'utils/formatCurrencyAmount'
|
||||
|
||||
const InputPanel = styled.div<{ hideInput?: boolean }>`
|
||||
${({ theme }) => theme.flexColumnNoWrap}
|
||||
@@ -149,7 +149,7 @@ interface CurrencyInputPanelProps {
|
||||
onUserInput: (value: string) => void
|
||||
onMax?: () => void
|
||||
showMaxButton: boolean
|
||||
label?: string
|
||||
label?: ReactNode
|
||||
onCurrencySelect?: (currency: Currency) => void
|
||||
currency?: Currency | null
|
||||
hideBalance?: boolean
|
||||
@@ -160,7 +160,7 @@ interface CurrencyInputPanelProps {
|
||||
priceImpact?: Percent
|
||||
id: string
|
||||
showCommonBases?: boolean
|
||||
customBalanceText?: string
|
||||
renderBalance?: (amount: CurrencyAmount<Currency>) => ReactNode
|
||||
locked?: boolean
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ export default function CurrencyInputPanel({
|
||||
otherCurrency,
|
||||
id,
|
||||
showCommonBases,
|
||||
customBalanceText,
|
||||
renderBalance,
|
||||
fiatValue,
|
||||
priceImpact,
|
||||
hideBalance = false,
|
||||
@@ -183,8 +183,6 @@ export default function CurrencyInputPanel({
|
||||
locked = false,
|
||||
...rest
|
||||
}: CurrencyInputPanelProps) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const [modalOpen, setModalOpen] = useState(false)
|
||||
const { account } = useActiveWeb3React()
|
||||
const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)
|
||||
@@ -200,8 +198,8 @@ export default function CurrencyInputPanel({
|
||||
<FixedContainer>
|
||||
<AutoColumn gap="sm" justify="center">
|
||||
<Lock />
|
||||
<TYPE.label fontSize="12px" textAlign="center">
|
||||
The market price is outside your specified price range. Single-asset deposit only.
|
||||
<TYPE.label fontSize="12px" textAlign="center" padding="0 12px">
|
||||
<Trans>The market price is outside your specified price range. Single-asset deposit only.</Trans>
|
||||
</TYPE.label>
|
||||
</AutoColumn>
|
||||
</FixedContainer>
|
||||
@@ -237,7 +235,7 @@ export default function CurrencyInputPanel({
|
||||
? currency.symbol.slice(0, 4) +
|
||||
'...' +
|
||||
currency.symbol.slice(currency.symbol.length - 5, currency.symbol.length)
|
||||
: currency?.symbol) || t('selectToken')}
|
||||
: currency?.symbol) || <Trans>Select a token</Trans>}
|
||||
</StyledTokenName>
|
||||
)}
|
||||
</RowFixed>
|
||||
@@ -268,19 +266,24 @@ export default function CurrencyInputPanel({
|
||||
fontSize={14}
|
||||
style={{ display: 'inline', cursor: 'pointer' }}
|
||||
>
|
||||
{!hideBalance && !!currency && selectedCurrencyBalance
|
||||
? (customBalanceText ?? 'Balance: ') +
|
||||
formatTokenAmount(selectedCurrencyBalance, 4) +
|
||||
' ' +
|
||||
currency.symbol
|
||||
: ''}
|
||||
{!hideBalance && currency && selectedCurrencyBalance ? (
|
||||
renderBalance ? (
|
||||
renderBalance(selectedCurrencyBalance)
|
||||
) : (
|
||||
<Trans>
|
||||
Balance: {formatCurrencyAmount(selectedCurrencyBalance, 4)} {currency.symbol}
|
||||
</Trans>
|
||||
)
|
||||
) : null}
|
||||
</TYPE.body>
|
||||
{showMaxButton && selectedCurrencyBalance ? (
|
||||
<StyledBalanceMax onClick={onMax}>(Max)</StyledBalanceMax>
|
||||
<StyledBalanceMax onClick={onMax}>
|
||||
<Trans>(Max)</Trans>
|
||||
</StyledBalanceMax>
|
||||
) : null}
|
||||
</RowFixed>
|
||||
) : (
|
||||
<span></span>
|
||||
<span />
|
||||
)}
|
||||
<FiatValue fiatValue={fiatValue} priceImpact={priceImpact} />
|
||||
</RowBetween>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import React from 'react'
|
||||
import { DAI, WBTC } from '../../constants/tokens'
|
||||
import Component, { DoubleCurrencyLogoProps } from './index'
|
||||
|
||||
export default {
|
||||
title: 'DoubleCurrencyLogo',
|
||||
decorators: [],
|
||||
}
|
||||
|
||||
const Template: Story<DoubleCurrencyLogoProps> = (args) => <Component {...args} />
|
||||
|
||||
export const DoubleCurrencyLogo = Template.bind({})
|
||||
DoubleCurrencyLogo.args = {
|
||||
currency0: DAI,
|
||||
currency1: WBTC,
|
||||
size: 220,
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React, { ErrorInfo } from 'react'
|
||||
import store, { AppState } from '../../state'
|
||||
import { ExternalLink, ThemedBackground, TYPE } from '../../theme'
|
||||
import { ExternalLink, TYPE } from '../../theme'
|
||||
import { AutoColumn } from '../Column'
|
||||
import styled from 'styled-components/macro'
|
||||
import ReactGA from 'react-ga'
|
||||
@@ -69,12 +70,11 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
|
||||
const encodedBody = encodeURIComponent(issueBody(error))
|
||||
return (
|
||||
<FallbackWrapper>
|
||||
<ThemedBackground />
|
||||
<BodyWrapper>
|
||||
<AutoColumn gap={'md'}>
|
||||
<SomethingWentWrongWrapper>
|
||||
<TYPE.label fontSize={24} fontWeight={600}>
|
||||
Something went wrong
|
||||
<Trans>Something went wrong</Trans>
|
||||
</TYPE.label>
|
||||
</SomethingWentWrongWrapper>
|
||||
<CodeBlockWrapper>
|
||||
@@ -92,7 +92,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
|
||||
target="_blank"
|
||||
>
|
||||
<TYPE.link fontSize={16}>
|
||||
Create an issue on GitHub
|
||||
<Trans>Create an issue on GitHub</Trans>
|
||||
<span>↗</span>
|
||||
</TYPE.link>
|
||||
</ExternalLink>
|
||||
@@ -100,7 +100,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
|
||||
<LinkWrapper>
|
||||
<ExternalLink id="get-support-on-discord" href="https://discord.gg/FCfyBSbCU5" target="_blank">
|
||||
<TYPE.link fontSize={16}>
|
||||
Get support on Discord
|
||||
<Trans>Get support on Discord</Trans>
|
||||
<span>↗</span>
|
||||
</TYPE.link>
|
||||
</ExternalLink>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { FeeAmount } from '@uniswap/v3-sdk'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { AutoColumn } from 'components/Column'
|
||||
import { DynamicSection } from 'pages/AddLiquidity/styled'
|
||||
import { TYPE } from 'theme'
|
||||
@@ -23,14 +23,14 @@ export default function FeeSelector({
|
||||
feeAmount?: FeeAmount
|
||||
handleFeePoolSelect: (feeAmount: FeeAmount) => void
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<AutoColumn gap="16px">
|
||||
<DynamicSection gap="md" disabled={disabled}>
|
||||
<TYPE.label>{t('selectPool')}</TYPE.label>
|
||||
<TYPE.label>
|
||||
<Trans>Select Pool</Trans>
|
||||
</TYPE.label>
|
||||
<TYPE.main fontSize={14} fontWeight={400} style={{ marginBottom: '.5rem', lineHeight: '125%' }}>
|
||||
Select a pool type based on your preferred liquidity provider fee.
|
||||
<Trans>Select a pool type based on your preferred liquidity provider fee.</Trans>
|
||||
</TYPE.main>
|
||||
<RowBetween>
|
||||
<ButtonRadioChecked
|
||||
@@ -39,9 +39,11 @@ export default function FeeSelector({
|
||||
onClick={() => handleFeePoolSelect(FeeAmount.LOW)}
|
||||
>
|
||||
<AutoColumn gap="sm" justify="flex-start">
|
||||
<ResponsiveText>0.05% {t('fee')}</ResponsiveText>
|
||||
<ResponsiveText>
|
||||
<Trans>0.05% fee</Trans>
|
||||
</ResponsiveText>
|
||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||
Best for stable pairs.
|
||||
<Trans>Best for stable pairs.</Trans>
|
||||
</TYPE.main>
|
||||
</AutoColumn>
|
||||
</ButtonRadioChecked>
|
||||
@@ -51,9 +53,11 @@ export default function FeeSelector({
|
||||
onClick={() => handleFeePoolSelect(FeeAmount.MEDIUM)}
|
||||
>
|
||||
<AutoColumn gap="sm" justify="flex-start">
|
||||
<ResponsiveText>0.3% {t('fee')}</ResponsiveText>
|
||||
<ResponsiveText>
|
||||
<Trans>0.3% fee</Trans>
|
||||
</ResponsiveText>
|
||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||
Best for most pairs.
|
||||
<Trans>Best for most pairs.</Trans>
|
||||
</TYPE.main>
|
||||
</AutoColumn>
|
||||
</ButtonRadioChecked>
|
||||
@@ -63,9 +67,11 @@ export default function FeeSelector({
|
||||
onClick={() => handleFeePoolSelect(FeeAmount.HIGH)}
|
||||
>
|
||||
<AutoColumn gap="sm" justify="flex-start">
|
||||
<ResponsiveText>1% {t('fee')}</ResponsiveText>
|
||||
<ResponsiveText>
|
||||
<Trans>1% fee</Trans>
|
||||
</ResponsiveText>
|
||||
<TYPE.main fontWeight={400} fontSize="12px" textAlign="left">
|
||||
Best for exotic pairs.
|
||||
<Trans>Best for exotic pairs.</Trans>
|
||||
</TYPE.main>
|
||||
</AutoColumn>
|
||||
</ButtonRadioChecked>
|
||||
|
||||
@@ -4,6 +4,7 @@ import styled from 'styled-components/macro'
|
||||
import { AlertTriangle, X } from 'react-feather'
|
||||
import { useURLWarningToggle, useURLWarningVisible } from '../../state/user/hooks'
|
||||
import { isMobile } from 'react-device-detect'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const PhishAlert = styled.div<{ isActive: any }>`
|
||||
width: 100%;
|
||||
@@ -29,17 +30,23 @@ export default function URLWarning() {
|
||||
return isMobile ? (
|
||||
<PhishAlert isActive={showURLWarning}>
|
||||
<div style={{ display: 'flex' }}>
|
||||
<AlertTriangle style={{ marginRight: 6 }} size={12} /> Make sure the URL is
|
||||
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code>
|
||||
<AlertTriangle style={{ marginRight: 6 }} size={12} />
|
||||
<Trans>
|
||||
Make sure the URL is
|
||||
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code>
|
||||
</Trans>
|
||||
</div>
|
||||
<StyledClose size={12} onClick={toggleURLWarning} />
|
||||
</PhishAlert>
|
||||
) : window.location.hostname === 'app.uniswap.org' ? (
|
||||
<PhishAlert isActive={showURLWarning}>
|
||||
<div style={{ display: 'flex' }}>
|
||||
<AlertTriangle style={{ marginRight: 6 }} size={12} /> Always make sure the URL is
|
||||
<code style={{ padding: '0 4px', display: 'inline', fontWeight: 'bold' }}>app.uniswap.org</code> - bookmark it
|
||||
to be safe.
|
||||
<AlertTriangle style={{ marginRight: 6 }} size={12} />
|
||||
<Trans>
|
||||
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>
|
||||
<StyledClose size={12} onClick={toggleURLWarning} />
|
||||
</PhishAlert>
|
||||
|
||||
@@ -16,6 +16,7 @@ import useUSDCPrice from '../../hooks/useUSDCPrice'
|
||||
import { AutoColumn } from '../Column'
|
||||
import { RowBetween } from '../Row'
|
||||
import { Break, CardBGImage, CardNoise, CardSection, DataCard } from '../earn/styled'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const ContentWrapper = styled(AutoColumn)`
|
||||
width: 100%;
|
||||
@@ -65,7 +66,9 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
|
||||
<CardNoise />
|
||||
<CardSection gap="md">
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">Your UNI Breakdown</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>Your UNI Breakdown</Trans>
|
||||
</TYPE.white>
|
||||
<StyledClose stroke="white" onClick={() => setShowUniBalanceModal(false)} />
|
||||
</RowBetween>
|
||||
</CardSection>
|
||||
@@ -81,16 +84,20 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
|
||||
</AutoColumn>
|
||||
<AutoColumn gap="md">
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">Balance:</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>Balance:</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white color="white">{uniBalance?.toFixed(2, { groupSeparator: ',' })}</TYPE.white>
|
||||
</RowBetween>
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">Unclaimed:</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>Unclaimed:</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
{uniToClaim?.toFixed(4, { groupSeparator: ',' })}{' '}
|
||||
{uniToClaim && uniToClaim.greaterThan('0') && (
|
||||
<StyledInternalLink onClick={() => setShowUniBalanceModal(false)} to="/uni">
|
||||
(claim)
|
||||
<Trans>(claim)</Trans>
|
||||
</StyledInternalLink>
|
||||
)}
|
||||
</TYPE.white>
|
||||
@@ -103,19 +110,27 @@ export default function UniBalanceContent({ setShowUniBalanceModal }: { setShowU
|
||||
<CardSection gap="sm">
|
||||
<AutoColumn gap="md">
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">UNI price:</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>UNI price:</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white color="white">${uniPrice?.toFixed(2) ?? '-'}</TYPE.white>
|
||||
</RowBetween>
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">UNI in circulation:</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>UNI in circulation:</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white color="white">{circulation?.toFixed(0, { groupSeparator: ',' })}</TYPE.white>
|
||||
</RowBetween>
|
||||
<RowBetween>
|
||||
<TYPE.white color="white">Total Supply</TYPE.white>
|
||||
<TYPE.white color="white">
|
||||
<Trans>Total Supply</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white color="white">{totalSupply?.toFixed(0, { groupSeparator: ',' })}</TYPE.white>
|
||||
</RowBetween>
|
||||
{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>View UNI Analytics</Trans>
|
||||
</ExternalLink>
|
||||
) : null}
|
||||
</AutoColumn>
|
||||
</CardSection>
|
||||
|
||||
@@ -3,12 +3,13 @@ import React, { useState } from 'react'
|
||||
import { Text } from 'rebass'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import { darken } from 'polished'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { Moon, Sun } from 'react-feather'
|
||||
import styled from 'styled-components/macro'
|
||||
|
||||
import Logo from '../../assets/svg/logo.svg'
|
||||
import LogoDark from '../../assets/svg/logo_white.svg'
|
||||
import { SupportedChainId } from '../../constants/chains'
|
||||
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useDarkModeManager } from '../../state/user/hooks'
|
||||
@@ -52,8 +53,7 @@ const HeaderFrame = styled.div<{ showBackground: boolean }>`
|
||||
|
||||
${({ theme }) => theme.mediaWidth.upToMedium`
|
||||
padding: 1rem;
|
||||
grid-template-columns: 120px 1fr;
|
||||
|
||||
grid-template-columns: auto 1fr;
|
||||
`};
|
||||
|
||||
${({ theme }) => theme.mediaWidth.upToExtraSmall`
|
||||
@@ -226,6 +226,7 @@ const StyledNavLink = styled(NavLink).attrs({
|
||||
width: fit-content;
|
||||
font-weight: 500;
|
||||
padding: 8px 12px;
|
||||
word-break: break-word;
|
||||
|
||||
&.${activeClassName} {
|
||||
border-radius: 12px;
|
||||
@@ -264,6 +265,7 @@ const StyledExternalLink = styled(ExternalLink).attrs({
|
||||
:hover,
|
||||
:focus {
|
||||
color: ${({ theme }) => darken(0.1, theme.text1)};
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
${({ theme }) => theme.mediaWidth.upToExtraSmall`
|
||||
@@ -300,16 +302,18 @@ export const StyledMenuButton = styled.button`
|
||||
}
|
||||
`
|
||||
|
||||
const NETWORK_LABELS: { [chainId: number]: string } = {
|
||||
[4]: 'Rinkeby',
|
||||
[3]: 'Ropsten',
|
||||
[5]: 'Görli',
|
||||
[42]: 'Kovan',
|
||||
const NETWORK_LABELS: { [chainId in SupportedChainId | number]: string } = {
|
||||
[SupportedChainId.MAINNET]: 'Mainnet',
|
||||
[SupportedChainId.RINKEBY]: 'Rinkeby',
|
||||
[SupportedChainId.ROPSTEN]: 'Ropsten',
|
||||
[SupportedChainId.GOERLI]: 'Görli',
|
||||
[SupportedChainId.KOVAN]: 'Kovan',
|
||||
[SupportedChainId.ARBITRUM_KOVAN]: 'kArbitrum',
|
||||
[SupportedChainId.ARBITRUM_ONE]: 'Arbitrum One',
|
||||
}
|
||||
|
||||
export default function Header() {
|
||||
const { account, chainId } = useActiveWeb3React()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const userEthBalance = useETHBalances(account ? [account] : [])?.[account ?? '']
|
||||
// const [isDark] = useDarkModeManager()
|
||||
@@ -341,7 +345,7 @@ export default function Header() {
|
||||
</HeaderRow>
|
||||
<HeaderLinks>
|
||||
<StyledNavLink id={`swap-nav-link`} to={'/swap'}>
|
||||
{t('swap')}
|
||||
<Trans>Swap</Trans>
|
||||
</StyledNavLink>
|
||||
<StyledNavLink
|
||||
id={`pool-nav-link`}
|
||||
@@ -354,19 +358,20 @@ export default function Header() {
|
||||
pathname.startsWith('/find')
|
||||
}
|
||||
>
|
||||
{t('pool')}
|
||||
<Trans>Pool</Trans>
|
||||
</StyledNavLink>
|
||||
<StyledNavLink id={`stake-nav-link`} to={'/vote'}>
|
||||
Vote
|
||||
<Trans>Vote</Trans>
|
||||
</StyledNavLink>
|
||||
<StyledExternalLink id={`stake-nav-link`} href={'https://info.uniswap.org'}>
|
||||
Charts <span style={{ fontSize: '11px', textDecoration: 'none !important' }}>↗</span>
|
||||
<Trans>Charts</Trans>
|
||||
<sup>↗</sup>
|
||||
</StyledExternalLink>
|
||||
</HeaderLinks>
|
||||
<HeaderControls>
|
||||
<HeaderElement>
|
||||
<HideSmall>
|
||||
{chainId && NETWORK_LABELS[chainId] && (
|
||||
{chainId && chainId !== SupportedChainId.MAINNET && NETWORK_LABELS[chainId] && (
|
||||
<NetworkCard title={NETWORK_LABELS[chainId]}>{NETWORK_LABELS[chainId]}</NetworkCard>
|
||||
)}
|
||||
</HideSmall>
|
||||
@@ -374,7 +379,13 @@ export default function Header() {
|
||||
<UNIWrapper onClick={toggleClaimModal}>
|
||||
<UNIAmount active={!!account && !availableClaim} style={{ pointerEvents: 'auto' }}>
|
||||
<TYPE.white padding="0 2px">
|
||||
{claimTxn && !claimTxn?.receipt ? <Dots>Claiming UNI</Dots> : 'Claim UNI'}
|
||||
{claimTxn && !claimTxn?.receipt ? (
|
||||
<Dots>
|
||||
<Trans>Claiming UNI</Trans>
|
||||
</Dots>
|
||||
) : (
|
||||
<Trans>Claim UNI</Trans>
|
||||
)}
|
||||
</TYPE.white>
|
||||
</UNIAmount>
|
||||
<CardNoise />
|
||||
@@ -383,7 +394,7 @@ export default function Header() {
|
||||
<AccountElement active={!!account} style={{ pointerEvents: 'auto' }}>
|
||||
{account && userEthBalance ? (
|
||||
<BalanceText style={{ flexShrink: 0 }} pl="0.75rem" pr="0.5rem" fontWeight={500}>
|
||||
{userEthBalance?.toSignificant(4)} ETH
|
||||
<Trans>{userEthBalance?.toSignificant(4)} ETH</Trans>
|
||||
</BalanceText>
|
||||
) : null}
|
||||
<Web3Status />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useCallback, useEffect } from 'react'
|
||||
import React, { useState, useCallback, useEffect, ReactNode } from 'react'
|
||||
import { LightCard } from 'components/Card'
|
||||
import { RowBetween } from 'components/Row'
|
||||
import { Input as NumericalInput } from '../NumericalInput'
|
||||
@@ -8,6 +8,7 @@ import { AutoColumn } from 'components/Column'
|
||||
import { ButtonPrimary } from 'components/Button'
|
||||
import { FeeAmount } from '@uniswap/v3-sdk'
|
||||
import { formattedFeeAmount } from 'utils'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const pulse = (color: string) => keyframes`
|
||||
0% {
|
||||
@@ -59,7 +60,7 @@ interface StepCounterProps {
|
||||
label?: string
|
||||
width?: string
|
||||
locked?: boolean // disable input
|
||||
title: string
|
||||
title: ReactNode
|
||||
tokenA: string | undefined
|
||||
tokenB: string | undefined
|
||||
}
|
||||
@@ -139,16 +140,22 @@ const StepCounter = ({
|
||||
}}
|
||||
/>
|
||||
<InputTitle fontSize={12} textAlign="center">
|
||||
{tokenB + ' per ' + tokenA}
|
||||
<Trans>
|
||||
{tokenB} per {tokenA}
|
||||
</Trans>
|
||||
</InputTitle>
|
||||
</AutoColumn>
|
||||
{!locked ? (
|
||||
<RowBetween>
|
||||
<SmallButton onClick={handleDecrement}>
|
||||
<TYPE.white fontSize="12px">-{feeAmountFormatted}%</TYPE.white>
|
||||
<TYPE.white fontSize="12px">
|
||||
<Trans>-{feeAmountFormatted}%</Trans>
|
||||
</TYPE.white>
|
||||
</SmallButton>
|
||||
<SmallButton onClick={handleIncrement}>
|
||||
<TYPE.white fontSize="12px">+{feeAmountFormatted}%</TYPE.white>
|
||||
<TYPE.white fontSize="12px">
|
||||
<Trans>+{feeAmountFormatted}%</Trans>
|
||||
</TYPE.white>
|
||||
</SmallButton>
|
||||
</RowBetween>
|
||||
) : null}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import React from 'react'
|
||||
// import Row, { RowFixed } from 'components/Row'
|
||||
import styled from 'styled-components/macro'
|
||||
import Component, { LineChartProps } from './'
|
||||
import { dummyData } from './data'
|
||||
// import { AutoColumn } from 'components/Column'
|
||||
// import { TYPE } from 'theme'
|
||||
// import DoubleCurrencyLogo from 'components/DoubleLogo'
|
||||
// import { MKR } from 'constants'
|
||||
// import { ETHER } from '@uniswap/sdk'
|
||||
// import LineChart from '.'
|
||||
|
||||
const Wrapper = styled.div`
|
||||
margin: 1em 2em;
|
||||
max-width: 500px;
|
||||
& > * {
|
||||
font-size: 1em;
|
||||
}
|
||||
`
|
||||
|
||||
export default {
|
||||
title: 'Charts',
|
||||
argTypes: {
|
||||
disabled: { control: { type: 'boolean' } },
|
||||
onClick: { action: 'clicked' },
|
||||
},
|
||||
decorators: [
|
||||
(Component: Story) => (
|
||||
<Wrapper>
|
||||
<Component />
|
||||
</Wrapper>
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
const Template: Story<LineChartProps> = (args) => <Component {...args}>{args.children}</Component>
|
||||
|
||||
export const Basic = Template.bind({})
|
||||
Basic.args = { data: dummyData }
|
||||
|
||||
// const Full = () => {
|
||||
// const [value, setValue] = useState<number | undefined>(dummyData[dummyData.length - 1].value)
|
||||
|
||||
// const dummyUSDPrice = 410 // used for conversion
|
||||
|
||||
// const TopLeftContent = () => (
|
||||
// <AutoColumn gap="md">
|
||||
// <RowFixed align="center">
|
||||
// <DoubleCurrencyLogo currency0={MKR} currency1={ETHER} size={20} />{' '}
|
||||
// <TYPE.main fontSize="20px" color="white" ml="10px">
|
||||
// ETH / MKR
|
||||
// </TYPE.main>
|
||||
// </RowFixed>
|
||||
// <Row>
|
||||
// <TYPE.main fontSize="20px" color="white">
|
||||
// {value} MKR
|
||||
// </TYPE.main>
|
||||
// <TYPE.main color="#565A69" fontSize="20px" ml="10px">
|
||||
// ($
|
||||
// {value
|
||||
// ? (value * dummyUSDPrice).toLocaleString('USD', {
|
||||
// currency: 'USD',
|
||||
// minimumFractionDigits: 2
|
||||
// })
|
||||
// : null}{' '}
|
||||
// )
|
||||
// </TYPE.main>
|
||||
// </Row>
|
||||
// </AutoColumn>
|
||||
// )
|
||||
|
||||
// return (
|
||||
// <Wrapper>
|
||||
// <LineChart data={dummyData} setValue={setValue} topLeft={<TopLeftContent />} />
|
||||
// </Wrapper>
|
||||
// )
|
||||
// }
|
||||
|
||||
// export const FullVersion = Template.bind(() => <LineChart data={dummyData} />)
|
||||
// Full.args = { data: dummyData }
|
||||
// Full.decorators = [
|
||||
// (Story: any) => {
|
||||
// return (
|
||||
// <Wrapper>
|
||||
// <LineChart data={dummyData} />
|
||||
// </Wrapper>
|
||||
// )
|
||||
// }
|
||||
// ]
|
||||
@@ -1,23 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import Component from './index'
|
||||
|
||||
const Wrapper = styled.div`
|
||||
max-width: 150px;
|
||||
`
|
||||
export default {
|
||||
title: 'Menu',
|
||||
decorators: [
|
||||
() => (
|
||||
<Wrapper>
|
||||
<Component />
|
||||
</Wrapper>
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
const Template: Story<any> = (args) => <Component {...args} />
|
||||
|
||||
export const Menu = Template.bind({})
|
||||
Menu.args = {}
|
||||
@@ -7,6 +7,7 @@ import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useOnClickOutside } from '../../hooks/useOnClickOutside'
|
||||
import { ApplicationModal } from '../../state/application/actions'
|
||||
import { useModalOpen, useToggleModal } from '../../state/application/hooks'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { ExternalLink } from '../../theme'
|
||||
import { ButtonPrimary } from '../Button'
|
||||
@@ -142,27 +143,37 @@ export default function Menu() {
|
||||
<MenuFlyout>
|
||||
<MenuItem href="https://uniswap.org/">
|
||||
<Info size={14} />
|
||||
<div>About</div>
|
||||
<div>
|
||||
<Trans>About</Trans>
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem href="https://docs.uniswap.org/">
|
||||
<BookOpen size={14} />
|
||||
<div>Docs</div>
|
||||
<div>
|
||||
<Trans>Docs</Trans>
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem href={CODE_LINK}>
|
||||
<Code size={14} />
|
||||
<div>Code</div>
|
||||
<div>
|
||||
<Trans>Code</Trans>
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem href="https://discord.gg/FCfyBSbCU5">
|
||||
<MessageCircle size={14} />
|
||||
<div>Discord</div>
|
||||
<div>
|
||||
<Trans>Discord</Trans>
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem href="https://info.uniswap.org/">
|
||||
<PieChart size={14} />
|
||||
<div>Analytics</div>
|
||||
<div>
|
||||
<Trans>Analytics</Trans>
|
||||
</div>
|
||||
</MenuItem>
|
||||
{account && (
|
||||
<UNIbutton onClick={openClaimModal} padding="8px 16px" width="100%" borderRadius="12px" mt="0.5rem">
|
||||
Claim UNI
|
||||
<Trans>Claim UNI</Trans>
|
||||
</UNIbutton>
|
||||
)}
|
||||
</MenuFlyout>
|
||||
|
||||
@@ -3,7 +3,6 @@ import styled, { css } from 'styled-components'
|
||||
import { animated, useTransition, useSpring } from 'react-spring'
|
||||
import { DialogOverlay, DialogContent } from '@reach/dialog'
|
||||
import { isMobile } from 'react-device-detect'
|
||||
import '@reach/dialog/styles.css'
|
||||
import { transparentize } from 'polished'
|
||||
import { useGesture } from 'react-use-gesture'
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import styled, { ThemeContext } from 'styled-components'
|
||||
import { RowBetween } from '../Row'
|
||||
import { TYPE, CloseIcon, CustomLightSpinner } from '../../theme'
|
||||
import { ArrowUpCircle } from 'react-feather'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import Circle from '../../assets/images/blue-loader.svg'
|
||||
import { ExternalLink } from '../../theme/components'
|
||||
@@ -32,7 +33,9 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss:
|
||||
</ConfirmedIcon>
|
||||
<AutoColumn gap="100px" justify={'center'}>
|
||||
{children}
|
||||
<TYPE.subHeader>Confirm this transaction in your wallet</TYPE.subHeader>
|
||||
<TYPE.subHeader>
|
||||
<Trans>Confirm this transaction in your wallet</Trans>
|
||||
</TYPE.subHeader>
|
||||
</AutoColumn>
|
||||
</ConfirmOrLoadingWrapper>
|
||||
)
|
||||
@@ -66,7 +69,9 @@ export function SubmittedView({
|
||||
href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}
|
||||
style={{ marginLeft: '4px' }}
|
||||
>
|
||||
<TYPE.subHeader>View transaction on Etherscan</TYPE.subHeader>
|
||||
<TYPE.subHeader>
|
||||
<Trans>View transaction on Explorer</Trans>
|
||||
</TYPE.subHeader>
|
||||
</ExternalLink>
|
||||
)}
|
||||
</AutoColumn>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import { darken } from 'polished'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { NavLink, Link as HistoryLink } from 'react-router-dom'
|
||||
import { Percent } from '@uniswap/sdk-core'
|
||||
|
||||
import { ArrowLeft } from 'react-feather'
|
||||
import { RowBetween } from '../Row'
|
||||
import SettingsTab from '../Settings'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { AppDispatch } from 'state'
|
||||
|
||||
import { useAppDispatch } from 'state/hooks'
|
||||
import { resetMintState } from 'state/mint/actions'
|
||||
import { resetMintState as resetMintV3State } from 'state/mint/v3/actions'
|
||||
import { TYPE } from 'theme'
|
||||
@@ -60,14 +60,13 @@ const StyledArrowLeft = styled(ArrowLeft)`
|
||||
`
|
||||
|
||||
export function SwapPoolTabs({ active }: { active: 'swap' | 'pool' }) {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Tabs style={{ marginBottom: '20px', display: 'none', padding: '1rem 1rem 0 1rem' }}>
|
||||
<StyledNavLink id={`swap-nav-link`} to={'/swap'} isActive={() => active === 'swap'}>
|
||||
{t('swap')}
|
||||
<Trans>Swap</Trans>
|
||||
</StyledNavLink>
|
||||
<StyledNavLink id={`pool-nav-link`} to={'/pool'} isActive={() => active === 'pool'}>
|
||||
{t('pool')}
|
||||
<Trans>Pool</Trans>
|
||||
</StyledNavLink>
|
||||
</Tabs>
|
||||
)
|
||||
@@ -80,7 +79,9 @@ export function FindPoolTabs({ origin }: { origin: string }) {
|
||||
<HistoryLink to={origin}>
|
||||
<StyledArrowLeft />
|
||||
</HistoryLink>
|
||||
<ActiveText>Import Pool</ActiveText>
|
||||
<ActiveText>
|
||||
<Trans>Import V2 Pool</Trans>
|
||||
</ActiveText>
|
||||
</RowBetween>
|
||||
</Tabs>
|
||||
)
|
||||
@@ -100,7 +101,7 @@ export function AddRemoveTabs({
|
||||
const theme = useTheme()
|
||||
|
||||
// reset states on back
|
||||
const dispatch = useDispatch<AppDispatch>()
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
return (
|
||||
<Tabs>
|
||||
@@ -118,7 +119,13 @@ export function AddRemoveTabs({
|
||||
<StyledArrowLeft stroke={theme.text2} />
|
||||
</HistoryLink>
|
||||
<TYPE.mediumHeader fontWeight={500} fontSize={20}>
|
||||
{creating ? 'Create a pair' : adding ? 'Add Liquidity' : 'Remove Liquidity'}
|
||||
{creating ? (
|
||||
<Trans>Create a pair</Trans>
|
||||
) : adding ? (
|
||||
<Trans>Add Liquidity</Trans>
|
||||
) : (
|
||||
<Trans>Remove Liquidity</Trans>
|
||||
)}
|
||||
</TYPE.mediumHeader>
|
||||
<SettingsTab placeholderSlippage={defaultSlippage} />
|
||||
</RowBetween>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
|
||||
import React, { useEffect } from 'react'
|
||||
import { X } from 'react-feather'
|
||||
import React, { useCallback, useEffect } from 'react'
|
||||
import ReactGA from 'react-ga'
|
||||
import { Heart, X } from 'react-feather'
|
||||
import styled, { keyframes } from 'styled-components'
|
||||
import tokenLogo from '../../assets/images/token-logo.png'
|
||||
import { ButtonPrimary } from '../../components/Button'
|
||||
@@ -62,6 +64,13 @@ export default function ClaimPopup() {
|
||||
// toggle for showing this modal
|
||||
const showClaimModal = useModalOpen(ApplicationModal.SELF_CLAIM)
|
||||
const toggleSelfClaimModal = useToggleSelfClaimModal()
|
||||
const handleToggleSelfClaimModal = useCallback(() => {
|
||||
ReactGA.event({
|
||||
category: 'MerkleDrop',
|
||||
action: 'Toggle self claim modal',
|
||||
})
|
||||
toggleSelfClaimModal()
|
||||
}, [toggleSelfClaimModal])
|
||||
|
||||
// const userHasAvailableclaim = useUserHasAvailableClaim()
|
||||
const userHasAvailableclaim: boolean = useUserHasAvailableClaim(account)
|
||||
@@ -70,6 +79,10 @@ export default function ClaimPopup() {
|
||||
// listen for available claim and show popup if needed
|
||||
useEffect(() => {
|
||||
if (userHasAvailableclaim) {
|
||||
ReactGA.event({
|
||||
category: 'MerkleDrop',
|
||||
action: 'Show claim popup',
|
||||
})
|
||||
toggleShowClaimPopup()
|
||||
}
|
||||
// the toggleShowClaimPopup function changes every time the popup changes, so this will cause an infinite loop.
|
||||
@@ -92,18 +105,20 @@ export default function ClaimPopup() {
|
||||
<span role="img" aria-label="party">
|
||||
🎉
|
||||
</span>{' '}
|
||||
UNI has arrived{' '}
|
||||
<Trans>UNI has arrived</Trans>{' '}
|
||||
<span role="img" aria-label="party">
|
||||
🎉
|
||||
</span>
|
||||
</TYPE.white>
|
||||
<TYPE.subHeader style={{ paddingTop: '0.5rem', textAlign: 'center' }} color="white">
|
||||
{`Thanks for being part of the Uniswap community <3`}
|
||||
<Trans>
|
||||
Thanks for being part of the Uniswap community <Heart size={12} />
|
||||
</Trans>
|
||||
</TYPE.subHeader>
|
||||
</AutoColumn>
|
||||
<AutoColumn style={{ zIndex: 10 }} justify="center">
|
||||
<ButtonPrimary padding="8px" borderRadius="8px" width={'fit-content'} onClick={toggleSelfClaimModal}>
|
||||
Claim your UNI tokens
|
||||
<ButtonPrimary padding="8px" borderRadius="8px" width={'fit-content'} onClick={handleToggleSelfClaimModal}>
|
||||
<Trans>Claim your UNI tokens</Trans>
|
||||
</ButtonPrimary>
|
||||
</AutoColumn>
|
||||
</StyledClaimPopup>
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
import { diffTokenLists, TokenList } from '@uniswap/token-lists'
|
||||
import React, { useCallback, useMemo } from 'react'
|
||||
import ReactGA from 'react-ga'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { Text } from 'rebass'
|
||||
import styled from 'styled-components/macro'
|
||||
import { AppDispatch } from '../../state'
|
||||
import { useRemovePopup } from '../../state/application/hooks'
|
||||
import { acceptListUpdate } from '../../state/lists/actions'
|
||||
import { TYPE } from '../../theme'
|
||||
import listVersionLabel from '../../utils/listVersionLabel'
|
||||
import { ButtonSecondary } from '../Button'
|
||||
import { AutoColumn } from '../Column'
|
||||
import { AutoRow } from '../Row'
|
||||
|
||||
export const ChangesList = styled.ul`
|
||||
max-height: 400px;
|
||||
overflow: auto;
|
||||
`
|
||||
|
||||
export default function ListUpdatePopup({
|
||||
popKey,
|
||||
listUrl,
|
||||
oldList,
|
||||
newList,
|
||||
auto,
|
||||
}: {
|
||||
popKey: string
|
||||
listUrl: string
|
||||
oldList: TokenList
|
||||
newList: TokenList
|
||||
auto: boolean
|
||||
}) {
|
||||
const removePopup = useRemovePopup()
|
||||
const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])
|
||||
const dispatch = useDispatch<AppDispatch>()
|
||||
|
||||
const handleAcceptUpdate = useCallback(() => {
|
||||
if (auto) return
|
||||
ReactGA.event({
|
||||
category: 'Lists',
|
||||
action: 'Update List from Popup',
|
||||
label: listUrl,
|
||||
})
|
||||
dispatch(acceptListUpdate(listUrl))
|
||||
removeThisPopup()
|
||||
}, [auto, dispatch, listUrl, removeThisPopup])
|
||||
|
||||
const {
|
||||
added: tokensAdded,
|
||||
changed: tokensChanged,
|
||||
removed: tokensRemoved,
|
||||
} = useMemo(() => {
|
||||
return diffTokenLists(oldList.tokens, newList.tokens)
|
||||
}, [newList.tokens, oldList.tokens])
|
||||
const numTokensChanged = useMemo(
|
||||
() =>
|
||||
Object.keys(tokensChanged).reduce((memo, chainId: any) => memo + Object.keys(tokensChanged[chainId]).length, 0),
|
||||
[tokensChanged]
|
||||
)
|
||||
|
||||
return (
|
||||
<AutoRow>
|
||||
<AutoColumn style={{ flex: '1' }} gap="8px">
|
||||
{auto ? (
|
||||
<TYPE.body fontWeight={500}>
|
||||
The token list "{oldList.name}" has been updated to{' '}
|
||||
<strong>{listVersionLabel(newList.version)}</strong>.
|
||||
</TYPE.body>
|
||||
) : (
|
||||
<>
|
||||
<div>
|
||||
<Text>
|
||||
An update is available for the token list "{oldList.name}" (
|
||||
{listVersionLabel(oldList.version)} to {listVersionLabel(newList.version)}).
|
||||
</Text>
|
||||
<ChangesList>
|
||||
{tokensAdded.length > 0 ? (
|
||||
<li>
|
||||
{tokensAdded.map((token, i) => (
|
||||
<React.Fragment key={`${token.chainId}-${token.address}`}>
|
||||
<strong title={token.address}>{token.symbol}</strong>
|
||||
{i === tokensAdded.length - 1 ? null : ', '}
|
||||
</React.Fragment>
|
||||
))}{' '}
|
||||
added
|
||||
</li>
|
||||
) : null}
|
||||
{tokensRemoved.length > 0 ? (
|
||||
<li>
|
||||
{tokensRemoved.map((token, i) => (
|
||||
<React.Fragment key={`${token.chainId}-${token.address}`}>
|
||||
<strong title={token.address}>{token.symbol}</strong>
|
||||
{i === tokensRemoved.length - 1 ? null : ', '}
|
||||
</React.Fragment>
|
||||
))}{' '}
|
||||
removed
|
||||
</li>
|
||||
) : null}
|
||||
{numTokensChanged > 0 ? <li>{numTokensChanged} tokens updated</li> : null}
|
||||
</ChangesList>
|
||||
</div>
|
||||
<AutoRow>
|
||||
<div style={{ flexGrow: 1, marginRight: 12 }}>
|
||||
<ButtonSecondary onClick={handleAcceptUpdate}>Accept update</ButtonSecondary>
|
||||
</div>
|
||||
<div style={{ flexGrow: 1 }}>
|
||||
<ButtonSecondary onClick={removeThisPopup}>Dismiss</ButtonSecondary>
|
||||
</div>
|
||||
</AutoRow>
|
||||
</>
|
||||
)}
|
||||
</AutoColumn>
|
||||
</AutoRow>
|
||||
)
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import styled, { ThemeContext } from 'styled-components'
|
||||
import { animated } from 'react-spring'
|
||||
import { PopupContent } from '../../state/application/actions'
|
||||
import { useRemovePopup } from '../../state/application/hooks'
|
||||
import ListUpdatePopup from './ListUpdatePopup'
|
||||
import TransactionPopup from './TransactionPopup'
|
||||
|
||||
export const StyledClose = styled(X)`
|
||||
@@ -77,11 +76,6 @@ export default function PopupItem({
|
||||
txn: { hash, success, summary },
|
||||
} = content
|
||||
popupContent = <TransactionPopup hash={hash} success={success} summary={summary} />
|
||||
} else if ('listUpdate' in content) {
|
||||
const {
|
||||
listUpdate: { listUrl, oldList, newList, auto },
|
||||
} = content
|
||||
popupContent = <ListUpdatePopup popKey={popKey} listUrl={listUrl} oldList={oldList} newList={newList} auto={auto} />
|
||||
}
|
||||
|
||||
const faderStyle = useSpring({
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function TransactionPopup({
|
||||
<TYPE.body fontWeight={500}>{summary ?? 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)}</TYPE.body>
|
||||
{chainId && (
|
||||
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
|
||||
View on Etherscan
|
||||
View on Explorer
|
||||
</ExternalLink>
|
||||
)}
|
||||
</AutoColumn>
|
||||
|
||||
@@ -33,7 +33,7 @@ const MobilePopupInner = styled.div`
|
||||
|
||||
const FixedPopupColumn = styled(AutoColumn)<{ extraPadding: boolean }>`
|
||||
position: fixed;
|
||||
top: ${({ extraPadding }) => (extraPadding ? '72px' : '88px')};
|
||||
top: ${({ extraPadding }) => (extraPadding ? '80px' : '88px')};
|
||||
right: 1rem;
|
||||
max-width: 355px !important;
|
||||
width: 100%;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Token } from '@uniswap/sdk-core'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Text } from 'rebass'
|
||||
import styled from 'styled-components/macro'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { unwrappedToken } from '../../utils/unwrappedToken'
|
||||
import { ButtonEmpty } from '../Button'
|
||||
@@ -48,7 +49,13 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord
|
||||
<AutoRow gap="8px">
|
||||
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`}
|
||||
{!currency0 || !currency1 ? (
|
||||
<Dots>
|
||||
<Trans>Loading</Trans>
|
||||
</Dots>
|
||||
) : (
|
||||
`${currency0.symbol}/${currency1.symbol}`
|
||||
)}
|
||||
</Text>
|
||||
|
||||
<Badge variant={BadgeVariant.WARNING}>Sushi</Badge>
|
||||
@@ -61,7 +68,7 @@ export default function SushiPositionCard({ tokenA, tokenB, liquidityToken, bord
|
||||
as={Link}
|
||||
to={`/migrate/v2/${liquidityToken.address}`}
|
||||
>
|
||||
Migrate
|
||||
<Trans>Migrate</Trans>
|
||||
</ButtonEmpty>
|
||||
</RowFixed>
|
||||
</FixedHeightRow>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Link } from 'react-router-dom'
|
||||
import { Text } from 'rebass'
|
||||
import styled from 'styled-components/macro'
|
||||
import { useTotalSupply } from '../../hooks/useTotalSupply'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useTokenBalance } from '../../state/wallet/hooks'
|
||||
@@ -85,7 +86,13 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
<AutoRow gap="8px">
|
||||
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`}
|
||||
{!currency0 || !currency1 ? (
|
||||
<Dots>
|
||||
<Trans>Loading</Trans>
|
||||
</Dots>
|
||||
) : (
|
||||
`${currency0.symbol}/${currency1.symbol}`
|
||||
)}
|
||||
</Text>
|
||||
</AutoRow>
|
||||
<RowFixed gap="8px">
|
||||
@@ -97,12 +104,12 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
>
|
||||
{showMore ? (
|
||||
<>
|
||||
Manage
|
||||
<Trans>Manage</Trans>
|
||||
<ChevronUp size="20" style={{ marginLeft: '10px' }} />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
Manage
|
||||
<Trans>Manage</Trans>
|
||||
<ChevronDown size="20" style={{ marginLeft: '10px' }} />
|
||||
</>
|
||||
)}
|
||||
@@ -114,7 +121,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
<AutoColumn gap="8px">
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Your total pool tokens:
|
||||
<Trans>Your total pool tokens:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}
|
||||
@@ -123,7 +130,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
{stakedBalance && (
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pool tokens in rewards pool:
|
||||
<Trans>Pool tokens in rewards pool:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{stakedBalance.toSignificant(4)}
|
||||
@@ -133,7 +140,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
<FixedHeightRow>
|
||||
<RowFixed>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pooled {currency0.symbol}:
|
||||
<Trans>Pooled {currency0.symbol}:</Trans>
|
||||
</Text>
|
||||
</RowFixed>
|
||||
{token0Deposited ? (
|
||||
@@ -151,7 +158,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
<FixedHeightRow>
|
||||
<RowFixed>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pooled {currency1.symbol}:
|
||||
<Trans>Pooled {currency1.symbol}:</Trans>
|
||||
</Text>
|
||||
</RowFixed>
|
||||
{token1Deposited ? (
|
||||
@@ -168,7 +175,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Your pool share:
|
||||
<Trans>Your pool share:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{poolTokenPercentage
|
||||
@@ -186,7 +193,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
to={`/migrate/v2/${pair.liquidityToken.address}`}
|
||||
width="64%"
|
||||
>
|
||||
Migrate
|
||||
<Trans>Migrate</Trans>
|
||||
</ButtonPrimary>
|
||||
<ButtonSecondary
|
||||
padding="8px"
|
||||
@@ -195,7 +202,7 @@ export default function V2PositionCard({ pair, border, stakedBalance }: Position
|
||||
width="32%"
|
||||
to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
|
||||
>
|
||||
Remove
|
||||
<Trans>Remove</Trans>
|
||||
</ButtonSecondary>
|
||||
</RowBetween>
|
||||
)}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Link } from 'react-router-dom'
|
||||
import { Text } from 'rebass'
|
||||
import styled from 'styled-components/macro'
|
||||
import { useTotalSupply } from '../../hooks/useTotalSupply'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useTokenBalance } from '../../state/wallet/hooks'
|
||||
@@ -91,7 +92,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
|
||||
<FixedHeightRow>
|
||||
<RowFixed>
|
||||
<Text fontWeight={500} fontSize={16}>
|
||||
Your position
|
||||
<Trans>Your position</Trans>
|
||||
</Text>
|
||||
</RowFixed>
|
||||
</FixedHeightRow>
|
||||
@@ -111,7 +112,7 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
|
||||
<AutoColumn gap="4px">
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Your pool share:
|
||||
<Trans>Your pool share:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{poolTokenPercentage ? poolTokenPercentage.toFixed(6) + '%' : '-'}
|
||||
@@ -154,8 +155,10 @@ export function MinimalPositionCard({ pair, showUnwrapped = false, border }: Pos
|
||||
<span role="img" aria-label="wizard-icon">
|
||||
⭐️
|
||||
</span>{' '}
|
||||
By adding liquidity you'll earn 0.3% of all trades on this pair proportional to your share of the pool.
|
||||
Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.
|
||||
<Trans>
|
||||
By adding liquidity you'll earn 0.3% of all trades on this pair proportional to your share of the
|
||||
pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.
|
||||
</Trans>{' '}
|
||||
</TYPE.subHeader>
|
||||
</LightCard>
|
||||
)}
|
||||
@@ -206,19 +209,25 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
<AutoRow gap="8px" style={{ marginLeft: '8px' }}>
|
||||
<DoubleCurrencyLogo currency0={currency0} currency1={currency1} size={20} />
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
{!currency0 || !currency1 ? <Dots>Loading</Dots> : `${currency0.symbol}/${currency1.symbol}`}
|
||||
{!currency0 || !currency1 ? (
|
||||
<Dots>
|
||||
<Trans>Loading</Trans>
|
||||
</Dots>
|
||||
) : (
|
||||
`${currency0.symbol}/${currency1.symbol}`
|
||||
)}
|
||||
</Text>
|
||||
</AutoRow>
|
||||
<RowFixed gap="8px" style={{ marginRight: '4px' }}>
|
||||
<ButtonEmpty padding="6px 8px" borderRadius="12px" width="100%" onClick={() => setShowMore(!showMore)}>
|
||||
{showMore ? (
|
||||
<>
|
||||
Manage
|
||||
<Trans>Manage</Trans>
|
||||
<ChevronUp size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
Manage
|
||||
<Trans>Manage</Trans>
|
||||
<ChevronDown size="20" style={{ marginLeft: '8px', height: '20px', minWidth: '20px' }} />
|
||||
</>
|
||||
)}
|
||||
@@ -230,7 +239,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
<AutoColumn gap="8px">
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Your total pool tokens:
|
||||
<Trans>Your total pool tokens:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}
|
||||
@@ -239,7 +248,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
{stakedBalance && (
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pool tokens in rewards pool:
|
||||
<Trans>Pool tokens in rewards pool:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{stakedBalance.toSignificant(4)}
|
||||
@@ -249,7 +258,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
<FixedHeightRow>
|
||||
<RowFixed>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pooled {currency0.symbol}:
|
||||
<Trans>Pooled {currency0.symbol}:</Trans>
|
||||
</Text>
|
||||
</RowFixed>
|
||||
{token0Deposited ? (
|
||||
@@ -267,7 +276,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
<FixedHeightRow>
|
||||
<RowFixed>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Pooled {currency1.symbol}:
|
||||
<Trans>Pooled {currency1.symbol}:</Trans>
|
||||
</Text>
|
||||
</RowFixed>
|
||||
{token1Deposited ? (
|
||||
@@ -284,12 +293,16 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
|
||||
<FixedHeightRow>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
Your pool share:
|
||||
<Trans>Your pool share:</Trans>
|
||||
</Text>
|
||||
<Text fontSize={16} fontWeight={500}>
|
||||
{poolTokenPercentage
|
||||
? (poolTokenPercentage.toFixed(2) === '0.00' ? '<0.01' : poolTokenPercentage.toFixed(2)) + '%'
|
||||
: '-'}
|
||||
{poolTokenPercentage ? (
|
||||
<Trans>
|
||||
{poolTokenPercentage.toFixed(2) === '0.00' ? '<0.01' : poolTokenPercentage.toFixed(2)} %
|
||||
</Trans>
|
||||
) : (
|
||||
'-'
|
||||
)}
|
||||
</Text>
|
||||
</FixedHeightRow>
|
||||
|
||||
@@ -298,7 +311,9 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
style={{ width: '100%', textAlign: 'center' }}
|
||||
href={`https://v2.info.uniswap.org/account/${account}`}
|
||||
>
|
||||
View accrued fees and analytics<span style={{ fontSize: '11px' }}>↗</span>
|
||||
<Trans>
|
||||
View accrued fees and analytics<span style={{ fontSize: '11px' }}>↗</span>
|
||||
</Trans>
|
||||
</ExternalLink>
|
||||
</ButtonSecondary>
|
||||
{userDefaultPoolBalance && JSBI.greaterThan(userDefaultPoolBalance.quotient, BIG_INT_ZERO) && (
|
||||
@@ -310,7 +325,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
to={`/migrate/v2/${pair.liquidityToken.address}`}
|
||||
width="32%"
|
||||
>
|
||||
Migrate
|
||||
<Trans>Migrate</Trans>
|
||||
</ButtonPrimary>
|
||||
<ButtonPrimary
|
||||
padding="8px"
|
||||
@@ -319,7 +334,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
to={`/add/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
|
||||
width="32%"
|
||||
>
|
||||
Add
|
||||
<Trans>Add</Trans>
|
||||
</ButtonPrimary>
|
||||
<ButtonPrimary
|
||||
padding="8px"
|
||||
@@ -328,7 +343,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
width="32%"
|
||||
to={`/remove/v2/${currencyId(currency0)}/${currencyId(currency1)}`}
|
||||
>
|
||||
Remove
|
||||
<Trans>Remove</Trans>
|
||||
</ButtonPrimary>
|
||||
</RowBetween>
|
||||
)}
|
||||
@@ -340,7 +355,7 @@ export default function FullPositionCard({ pair, border, stakedBalance }: Positi
|
||||
to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`}
|
||||
width="100%"
|
||||
>
|
||||
Manage Liquidity in Rewards Pool
|
||||
<Trans>Manage Liquidity in Rewards Pool</Trans>
|
||||
</ButtonPrimary>
|
||||
)}
|
||||
</AutoColumn>
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// import { Story } from '@storybook/react/types-6-0'
|
||||
// import React from 'react'
|
||||
// import { Position } from 'types/position'
|
||||
// import { basisPointsToPercent } from 'utils'
|
||||
// import { DAI, WBTC } from '../../constants'
|
||||
// import Component, { PositionListProps } from './index'
|
||||
// import { CurrencyAmount } from '@uniswap/sdk-core'
|
||||
// import JSBI from 'jsbi'
|
||||
|
||||
// const FEE_BIPS = {
|
||||
// FIVE: basisPointsToPercent(5),
|
||||
// THIRTY: basisPointsToPercent(30),
|
||||
// ONE_HUNDRED: basisPointsToPercent(100),
|
||||
// }
|
||||
// const daiAmount = CurrencyAmount.fromRawAmount(DAI, JSBI.BigInt(500 * 10 ** 18))
|
||||
// const wbtcAmount = CurrencyAmount.fromRawAmount(WBTC, JSBI.BigInt(10 ** 7))
|
||||
// const positions = [
|
||||
// {
|
||||
// feesEarned: {
|
||||
// DAI: 1000,
|
||||
// WBTC: 0.005,
|
||||
// },
|
||||
// feeLevel: FEE_BIPS.FIVE,
|
||||
// tokenAmount0: daiAmount,
|
||||
// tokenAmount1: wbtcAmount,
|
||||
// tickLower: 40000,
|
||||
// tickUpper: 60000,
|
||||
// },
|
||||
// {
|
||||
// feesEarned: {
|
||||
// DAI: 1000,
|
||||
// WBTC: 0.005,
|
||||
// },
|
||||
// feeLevel: FEE_BIPS.THIRTY,
|
||||
// tokenAmount0: daiAmount,
|
||||
// tokenAmount1: wbtcAmount,
|
||||
// tickLower: 45000,
|
||||
// tickUpper: 55000,
|
||||
// },
|
||||
// ]
|
||||
// const positions: Position[] = []
|
||||
|
||||
export default {
|
||||
title: 'PositionList',
|
||||
}
|
||||
|
||||
// const Template: Story<PositionListProps> = (args) => <Component {...args} />
|
||||
|
||||
// export const PositionList = Template.bind({})
|
||||
// PositionList.args = {
|
||||
// positions,
|
||||
// showUnwrapped: true,
|
||||
// }
|
||||
@@ -1,6 +1,6 @@
|
||||
import PositionListItem from 'components/PositionListItem'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import styled from 'styled-components/macro'
|
||||
import { MEDIA_WIDTHS } from 'theme'
|
||||
import { PositionDetails } from 'types/position'
|
||||
@@ -39,18 +39,20 @@ export type PositionListProps = React.PropsWithChildren<{
|
||||
}>
|
||||
|
||||
export default function PositionList({ positions }: PositionListProps) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<>
|
||||
<DesktopHeader>
|
||||
<div>
|
||||
{t('Your positions')}
|
||||
<Trans>Your positions</Trans>
|
||||
{positions && ' (' + positions.length + ')'}
|
||||
</div>
|
||||
<div>{t('Price range')}</div>
|
||||
<div>
|
||||
<Trans>Price range</Trans>
|
||||
</div>
|
||||
</DesktopHeader>
|
||||
<MobileHeader>Your positions</MobileHeader>
|
||||
<MobileHeader>
|
||||
<Trans>Your positions</Trans>
|
||||
</MobileHeader>
|
||||
{positions.map((p) => {
|
||||
return <PositionListItem key={p.tokenId.toString()} positionDetails={p} />
|
||||
})}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// import { Story } from '@storybook/react/types-6-0'
|
||||
// import { FeeAmount, MAX_TICK, MIN_TICK, TICK_SPACINGS } from '@uniswap/v3-sdk'
|
||||
// import { BigNumber } from 'ethers'
|
||||
// import React from 'react'
|
||||
// import { Position } from 'types/position'
|
||||
// import Component, { PositionListItemProps } from './index'
|
||||
|
||||
// const position: Position = {
|
||||
// nonce: BigNumber.from(0),
|
||||
// operator: '',
|
||||
// token0: '',
|
||||
// token1: '',
|
||||
// fee: FeeAmount.LOW,
|
||||
// tickLower: MIN_TICK(TICK_SPACINGS[FeeAmount.LOW]),
|
||||
// tickUpper: MAX_TICK(TICK_SPACINGS[FeeAmount.LOW]),
|
||||
// liquidity,
|
||||
// feeGrowthInside0LastX128fee
|
||||
// feeGrowthInside0LastX128
|
||||
// feeGrowthInside1LastX128
|
||||
// tokensOwed0
|
||||
// tokensOwed1
|
||||
// }
|
||||
|
||||
export default {
|
||||
title: 'PositionListItem',
|
||||
}
|
||||
|
||||
// const Template: Story<PositionListItemProps> = (args) => <Component {...args} />
|
||||
|
||||
// export const PositionListItem = Template.bind({})
|
||||
// PositionListItem.args = {position}
|
||||
@@ -8,14 +8,15 @@ import { Link } from 'react-router-dom'
|
||||
import styled from 'styled-components/macro'
|
||||
import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme'
|
||||
import { PositionDetails } from 'types/position'
|
||||
import { WETH9, Price, Token, Percent } from '@uniswap/sdk-core'
|
||||
import { formatPrice } from 'utils/formatTokenAmount'
|
||||
import { Price, Token, Percent } from '@uniswap/sdk-core'
|
||||
import { formatPrice } from 'utils/formatCurrencyAmount'
|
||||
import Loader from 'components/Loader'
|
||||
import { unwrappedToken } from 'utils/unwrappedToken'
|
||||
import RangeBadge from 'components/Badge/RangeBadge'
|
||||
import { RowFixed } from 'components/Row'
|
||||
import HoverInlineText from 'components/HoverInlineText'
|
||||
import { DAI, USDC, USDT, WBTC } from '../../constants/tokens'
|
||||
import { DAI, USDC, USDT, WBTC, WETH9_EXTENDED } from '../../constants/tokens'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const LinkRow = styled(Link)`
|
||||
align-items: center;
|
||||
@@ -145,7 +146,7 @@ export function getPriceOrderingFromPositionForUI(position?: Position): {
|
||||
}
|
||||
|
||||
// if token1 is an ETH-/BTC-stable asset, set it as the base token
|
||||
const bases = [...Object.values(WETH9), WBTC]
|
||||
const bases = [...Object.values(WETH9_EXTENDED), WBTC]
|
||||
if (bases.some((base) => base.equals(token1))) {
|
||||
return {
|
||||
priceLower: position.token0PriceUpper.invert(),
|
||||
@@ -223,7 +224,9 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
|
||||
</DataText>
|
||||
|
||||
<Badge>
|
||||
<BadgeText>{new Percent(feeAmount, 1_000_000).toSignificant()}%</BadgeText>
|
||||
<BadgeText>
|
||||
<Trans>{new Percent(feeAmount, 1_000_000).toSignificant()}%</Trans>
|
||||
</BadgeText>
|
||||
</Badge>
|
||||
</PrimaryPositionIdData>
|
||||
<RangeBadge removed={removed} inRange={!outOfRange} />
|
||||
@@ -232,9 +235,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
|
||||
{priceLower && priceUpper ? (
|
||||
<RangeLineItem>
|
||||
<RangeText>
|
||||
<ExtentsText>Min: </ExtentsText>
|
||||
{formatPrice(priceLower, 5)} <HoverInlineText text={currencyQuote?.symbol} /> {' per '}{' '}
|
||||
<HoverInlineText text={currencyBase?.symbol ?? ''} />
|
||||
<ExtentsText>
|
||||
<Trans>Min: </Trans>
|
||||
</ExtentsText>
|
||||
<Trans>
|
||||
{formatPrice(priceLower, 5)} <HoverInlineText text={currencyQuote?.symbol} /> per{' '}
|
||||
<HoverInlineText text={currencyBase?.symbol ?? ''} />
|
||||
</Trans>
|
||||
</RangeText>{' '}
|
||||
<HideSmall>
|
||||
<DoubleArrow>⟷</DoubleArrow>{' '}
|
||||
@@ -243,9 +250,13 @@ export default function PositionListItem({ positionDetails }: PositionListItemPr
|
||||
<DoubleArrow>↕</DoubleArrow>{' '}
|
||||
</SmallOnly>
|
||||
<RangeText>
|
||||
<ExtentsText>Max:</ExtentsText>
|
||||
{formatPrice(priceUpper, 5)} <HoverInlineText text={currencyQuote?.symbol} /> {' per '}{' '}
|
||||
<HoverInlineText maxCharacters={10} text={currencyBase?.symbol} />
|
||||
<ExtentsText>
|
||||
<Trans>Max:</Trans>
|
||||
</ExtentsText>
|
||||
<Trans>
|
||||
{formatPrice(priceUpper, 5)} <HoverInlineText text={currencyQuote?.symbol} /> per{' '}
|
||||
<HoverInlineText maxCharacters={10} text={currencyBase?.symbol} />
|
||||
</Trans>
|
||||
</RangeText>
|
||||
</RangeLineItem>
|
||||
) : (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useCallback, useContext } from 'react'
|
||||
import React, { useState, useCallback, useContext, ReactNode } from 'react'
|
||||
import { Position } from '@uniswap/v3-sdk'
|
||||
import { LightCard } from 'components/Card'
|
||||
import { AutoColumn } from 'components/Column'
|
||||
@@ -7,7 +7,7 @@ import { RowBetween, RowFixed } from 'components/Row'
|
||||
import CurrencyLogo from 'components/CurrencyLogo'
|
||||
import { unwrappedToken } from 'utils/unwrappedToken'
|
||||
import { Break } from 'components/earn/styled'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { Currency } from '@uniswap/sdk-core'
|
||||
import RateToggle from 'components/RateToggle'
|
||||
import DoubleCurrencyLogo from 'components/DoubleLogo'
|
||||
@@ -22,12 +22,10 @@ export const PositionPreview = ({
|
||||
baseCurrencyDefault,
|
||||
}: {
|
||||
position: Position
|
||||
title?: string
|
||||
title?: ReactNode
|
||||
inRange: boolean
|
||||
baseCurrencyDefault?: Currency | undefined
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const theme = useContext(ThemeContext)
|
||||
|
||||
const currency0 = unwrappedToken(position.pool.token0)
|
||||
@@ -97,8 +95,12 @@ export const PositionPreview = ({
|
||||
</RowBetween>
|
||||
<Break />
|
||||
<RowBetween>
|
||||
<TYPE.label>{t('feeTier')}</TYPE.label>
|
||||
<TYPE.label>{position?.pool?.fee / 10000}%</TYPE.label>
|
||||
<TYPE.label>
|
||||
<Trans>Fee Tier</Trans>
|
||||
</TYPE.label>
|
||||
<TYPE.label>
|
||||
<Trans>{position?.pool?.fee / 10000}%</Trans>
|
||||
</TYPE.label>
|
||||
</RowBetween>
|
||||
</AutoColumn>
|
||||
</LightCard>
|
||||
@@ -116,40 +118,49 @@ export const PositionPreview = ({
|
||||
<RowBetween>
|
||||
<LightCard width="48%" padding="8px">
|
||||
<AutoColumn gap="4px" justify="center">
|
||||
<TYPE.main fontSize="12px">Min Price</TYPE.main>
|
||||
<TYPE.main fontSize="12px">
|
||||
<Trans>Min Price</Trans>
|
||||
</TYPE.main>
|
||||
<TYPE.mediumHeader textAlign="center">{`${priceLower.toSignificant(5)}`}</TYPE.mediumHeader>
|
||||
<TYPE.main
|
||||
textAlign="center"
|
||||
fontSize="12px"
|
||||
>{` ${quoteCurrency.symbol}/${baseCurrency.symbol}`}</TYPE.main>
|
||||
<TYPE.main textAlign="center" fontSize="12px">
|
||||
<Trans>
|
||||
{quoteCurrency.symbol} per {baseCurrency.symbol}
|
||||
</Trans>
|
||||
</TYPE.main>
|
||||
<TYPE.small textAlign="center" color={theme.text3} style={{ marginTop: '4px' }}>
|
||||
Your position will be 100% composed of {baseCurrency?.symbol} at this price
|
||||
<Trans>Your position will be 100% composed of {baseCurrency?.symbol} at this price</Trans>
|
||||
</TYPE.small>
|
||||
</AutoColumn>
|
||||
</LightCard>
|
||||
|
||||
<LightCard width="48%" padding="8px">
|
||||
<AutoColumn gap="4px" justify="center">
|
||||
<TYPE.main fontSize="12px">Max Price</TYPE.main>
|
||||
<TYPE.main fontSize="12px">
|
||||
<Trans>Max Price</Trans>
|
||||
</TYPE.main>
|
||||
<TYPE.mediumHeader textAlign="center">{`${priceUpper.toSignificant(5)}`}</TYPE.mediumHeader>
|
||||
<TYPE.main
|
||||
textAlign="center"
|
||||
fontSize="12px"
|
||||
>{` ${quoteCurrency.symbol} per ${baseCurrency.symbol}`}</TYPE.main>
|
||||
<TYPE.main textAlign="center" fontSize="12px">
|
||||
<Trans>
|
||||
{quoteCurrency.symbol} per {baseCurrency.symbol}
|
||||
</Trans>
|
||||
</TYPE.main>
|
||||
<TYPE.small textAlign="center" color={theme.text3} style={{ marginTop: '4px' }}>
|
||||
Your position will be 100% composed of {quoteCurrency?.symbol} at this price
|
||||
<Trans>Your position will be 100% composed of {quoteCurrency?.symbol} at this price</Trans>
|
||||
</TYPE.small>
|
||||
</AutoColumn>
|
||||
</LightCard>
|
||||
</RowBetween>
|
||||
<LightCard padding="12px ">
|
||||
<AutoColumn gap="4px" justify="center">
|
||||
<TYPE.main fontSize="12px">Current price</TYPE.main>
|
||||
<TYPE.main fontSize="12px">
|
||||
<Trans>Current price</Trans>
|
||||
</TYPE.main>
|
||||
<TYPE.mediumHeader>{`${price.toSignificant(5)} `}</TYPE.mediumHeader>
|
||||
<TYPE.main
|
||||
textAlign="center"
|
||||
fontSize="12px"
|
||||
>{` ${quoteCurrency.symbol} per ${baseCurrency.symbol}`}</TYPE.main>
|
||||
<TYPE.main textAlign="center" fontSize="12px">
|
||||
<Trans>
|
||||
{quoteCurrency.symbol} per {baseCurrency.symbol}
|
||||
</Trans>
|
||||
</TYPE.main>
|
||||
</AutoColumn>
|
||||
</LightCard>
|
||||
</AutoColumn>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import React, { ReactNode, useCallback, useState } from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import Tooltip from '../Tooltip'
|
||||
|
||||
@@ -24,32 +24,11 @@ const QuestionWrapper = styled.div`
|
||||
}
|
||||
`
|
||||
|
||||
const LightQuestionWrapper = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.2rem;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: none;
|
||||
cursor: default;
|
||||
border-radius: 36px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
color: ${({ theme }) => theme.white};
|
||||
|
||||
:hover,
|
||||
:focus {
|
||||
opacity: 0.7;
|
||||
}
|
||||
`
|
||||
|
||||
const QuestionMark = styled.span`
|
||||
font-size: 14px;
|
||||
`
|
||||
|
||||
export default function QuestionHelper({ text }: { text: string; size?: number }) {
|
||||
export default function QuestionHelper({ text }: { text: ReactNode; size?: number }) {
|
||||
const [show, setShow] = useState<boolean>(false)
|
||||
|
||||
const open = useCallback(() => setShow(true), [setShow])
|
||||
@@ -65,20 +44,3 @@ export default function QuestionHelper({ text }: { text: string; size?: number }
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export function LightQuestionHelper({ text }: { text: string }) {
|
||||
const [show, setShow] = useState<boolean>(false)
|
||||
|
||||
const open = useCallback(() => setShow(true), [setShow])
|
||||
const close = useCallback(() => setShow(false), [setShow])
|
||||
|
||||
return (
|
||||
<span style={{ marginLeft: 4 }}>
|
||||
<Tooltip text={text} show={show}>
|
||||
<LightQuestionWrapper onClick={open} onMouseEnter={open} onMouseLeave={close}>
|
||||
<QuestionMark>?</QuestionMark>
|
||||
</LightQuestionWrapper>
|
||||
</Tooltip>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React from 'react'
|
||||
import { Currency, Price, Token } from '@uniswap/sdk-core'
|
||||
import StepCounter from 'components/InputStepCounter/InputStepCounter'
|
||||
@@ -46,7 +47,7 @@ export default function RangeSelector({
|
||||
increment={isSorted ? getIncrementLower : getDecrementUpper}
|
||||
feeAmount={feeAmount}
|
||||
label={leftPrice ? `${currencyB?.symbol}` : '-'}
|
||||
title={'Min Price'}
|
||||
title={<Trans>Min Price</Trans>}
|
||||
tokenA={currencyA?.symbol}
|
||||
tokenB={currencyB?.symbol}
|
||||
/>
|
||||
@@ -60,7 +61,7 @@ export default function RangeSelector({
|
||||
label={rightPrice ? `${currencyB?.symbol}` : '-'}
|
||||
tokenA={currencyA?.symbol}
|
||||
tokenB={currencyB?.symbol}
|
||||
title={'Max Price'}
|
||||
title={<Trans>Max Price</Trans>}
|
||||
/>
|
||||
</RowBetween>
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React from 'react'
|
||||
import { Currency } from '@uniswap/sdk-core'
|
||||
import { ToggleElement, ToggleWrapper } from 'components/Toggle/MultiToggle'
|
||||
@@ -19,13 +20,13 @@ export default function RateToggle({
|
||||
const isSorted = tokenA && tokenB && tokenA.sortsBefore(tokenB)
|
||||
|
||||
return tokenA && tokenB ? (
|
||||
<div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }}>
|
||||
<div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }} onClick={handleRateToggle}>
|
||||
<ToggleWrapper width="fit-content">
|
||||
<ToggleElement isActive={isSorted} fontSize="12px" onClick={handleRateToggle}>
|
||||
{isSorted ? currencyA.symbol + ' price ' : currencyB.symbol + ' price '}
|
||||
<ToggleElement isActive={isSorted} fontSize="12px">
|
||||
<Trans>{isSorted ? currencyA.symbol : currencyB.symbol} price</Trans>
|
||||
</ToggleElement>
|
||||
<ToggleElement isActive={!isSorted} fontSize="12px" onClick={handleRateToggle}>
|
||||
{isSorted ? currencyB.symbol + ' price ' : currencyA.symbol + ' price '}
|
||||
<ToggleElement isActive={!isSorted} fontSize="12px">
|
||||
<Trans>{isSorted ? currencyB.symbol : currencyA.symbol} price</Trans>
|
||||
</ToggleElement>
|
||||
</ToggleWrapper>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React from 'react'
|
||||
import { Text } from 'rebass'
|
||||
import { Currency } from '@uniswap/sdk-core'
|
||||
@@ -41,9 +42,9 @@ export default function CommonBases({
|
||||
<AutoColumn gap="md">
|
||||
<AutoRow>
|
||||
<Text fontWeight={500} fontSize={14}>
|
||||
Common bases
|
||||
<Trans>Common bases</Trans>
|
||||
</Text>
|
||||
<QuestionHelper text="These tokens are commonly paired with other tokens." />
|
||||
<QuestionHelper text={<Trans>These tokens are commonly paired with other tokens.</Trans>} />
|
||||
</AutoRow>
|
||||
<AutoRow gap="4px">
|
||||
{bases.map((currency: Currency) => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
|
||||
import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
|
||||
import { FixedSizeList } from 'react-window'
|
||||
@@ -132,7 +133,11 @@ function CurrencyRow({
|
||||
{currency.symbol}
|
||||
</Text>
|
||||
<TYPE.darkGray ml="0px" fontSize={'12px'} fontWeight={300}>
|
||||
{currency.name} {!currency.isNative && !isOnSelectedList && customAdded && '• Added by user'}
|
||||
{!currency.isNative && !isOnSelectedList && customAdded ? (
|
||||
<Trans>{currency.name} • Added by user</Trans>
|
||||
) : (
|
||||
currency.name
|
||||
)}
|
||||
</TYPE.darkGray>
|
||||
</Column>
|
||||
<TokenTags currency={currency} />
|
||||
@@ -158,10 +163,16 @@ function BreakLineComponent({ style }: { style: CSSProperties }) {
|
||||
<RowFixed>
|
||||
<TokenListLogoWrapper src={TokenListLogo} />
|
||||
<TYPE.main ml="6px" fontSize="12px" color={theme.text1}>
|
||||
Expanded results from inactive Token Lists
|
||||
<Trans>Expanded results from inactive Token Lists</Trans>
|
||||
</TYPE.main>
|
||||
</RowFixed>
|
||||
<QuestionHelper text="Tokens from inactive lists. Import specific tokens below or click 'Manage' to activate more lists." />
|
||||
<QuestionHelper
|
||||
text={
|
||||
<Trans>
|
||||
Tokens from inactive lists. Import specific tokens below or click Manage to activate more lists.
|
||||
</Trans>
|
||||
}
|
||||
/>
|
||||
</RowBetween>
|
||||
</LightGreyCard>
|
||||
</FixedContentRow>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Currency, Ether, Token } from '@uniswap/sdk-core'
|
||||
import { Currency, Token } from '@uniswap/sdk-core'
|
||||
import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import ReactGA from 'react-ga'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
import { FixedSizeList } from 'react-window'
|
||||
import { Text } from 'rebass'
|
||||
import { ExtendedEther } from '../../constants/tokens'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { useAllTokens, useToken, useIsUserAddedToken, useSearchInactiveTokenLists } from '../../hooks/Tokens'
|
||||
import { CloseIcon, TYPE, ButtonText, IconWrapper } from '../../theme'
|
||||
@@ -63,7 +64,6 @@ export function CurrencySearch({
|
||||
showImportView,
|
||||
setImportToken,
|
||||
}: CurrencySearchProps) {
|
||||
const { t } = useTranslation()
|
||||
const { chainId } = useActiveWeb3React()
|
||||
const theme = useTheme()
|
||||
|
||||
@@ -106,7 +106,7 @@ export function CurrencySearch({
|
||||
|
||||
const filteredSortedTokens = useSortedTokensByQuery(sortedTokens, debouncedQuery)
|
||||
|
||||
const ether = useMemo(() => chainId && Ether.onChain(chainId), [chainId])
|
||||
const ether = useMemo(() => chainId && ExtendedEther.onChain(chainId), [chainId])
|
||||
|
||||
const filteredSortedTokensWithETH: Currency[] = useMemo(() => {
|
||||
const s = debouncedQuery.toLowerCase().trim()
|
||||
@@ -172,7 +172,7 @@ export function CurrencySearch({
|
||||
<PaddedColumn gap="16px">
|
||||
<RowBetween>
|
||||
<Text fontWeight={500} fontSize={16}>
|
||||
Select a token
|
||||
<Trans>Select a token</Trans>
|
||||
</Text>
|
||||
<CloseIcon onClick={onDismiss} />
|
||||
</RowBetween>
|
||||
@@ -180,7 +180,7 @@ export function CurrencySearch({
|
||||
<SearchInput
|
||||
type="text"
|
||||
id="token-search-input"
|
||||
placeholder={t('tokenSearchPlaceholder')}
|
||||
placeholder={t`Search name or paste address`}
|
||||
autoComplete="off"
|
||||
value={searchQuery}
|
||||
ref={inputRef as RefObject<HTMLInputElement>}
|
||||
@@ -218,7 +218,7 @@ export function CurrencySearch({
|
||||
) : (
|
||||
<Column style={{ padding: '20px', height: '100%' }}>
|
||||
<TYPE.main color={theme.text3} textAlign="center" mb="20px">
|
||||
No results found.
|
||||
<Trans>No results found.</Trans>
|
||||
</TYPE.main>
|
||||
</Column>
|
||||
)}
|
||||
@@ -229,7 +229,9 @@ export function CurrencySearch({
|
||||
<IconWrapper size="16px" marginRight="6px">
|
||||
<Edit />
|
||||
</IconWrapper>
|
||||
<TYPE.main color={theme.blue1}>Manage Token Lists</TYPE.main>
|
||||
<TYPE.main color={theme.blue1}>
|
||||
<Trans>Manage Token Lists</Trans>
|
||||
</TYPE.main>
|
||||
</RowFixed>
|
||||
</ButtonText>
|
||||
</Row>
|
||||
|
||||
@@ -14,12 +14,13 @@ import { ExternalLink } from '../../theme/components'
|
||||
import ListLogo from 'components/ListLogo'
|
||||
import { PaddedColumn, Checkbox, TextDot } from './styleds'
|
||||
import { TokenList } from '@uniswap/token-lists'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { AppDispatch } from 'state'
|
||||
|
||||
import { useAppDispatch } from 'state/hooks'
|
||||
import { useFetchListCallback } from 'hooks/useFetchListCallback'
|
||||
import { removeList, enableList } from 'state/lists/actions'
|
||||
import { CurrencyModalView } from './CurrencySearchModal'
|
||||
import { useAllLists } from 'state/lists/hooks'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const Wrapper = styled.div`
|
||||
position: relative;
|
||||
@@ -36,7 +37,7 @@ interface ImportProps {
|
||||
|
||||
export function ImportList({ listURL, list, setModalView, onDismiss }: ImportProps) {
|
||||
const theme = useTheme()
|
||||
const dispatch = useDispatch<AppDispatch>()
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
// user must accept
|
||||
const [confirmed, setConfirmed] = useState(false)
|
||||
@@ -80,7 +81,9 @@ export function ImportList({ listURL, list, setModalView, onDismiss }: ImportPro
|
||||
<PaddedColumn gap="14px" style={{ width: '100%', flex: '1 1' }}>
|
||||
<RowBetween>
|
||||
<ArrowLeft style={{ cursor: 'pointer' }} onClick={() => setModalView(CurrencyModalView.manage)} />
|
||||
<TYPE.mediumHeader>Import List</TYPE.mediumHeader>
|
||||
<TYPE.mediumHeader>
|
||||
<Trans>Import List</Trans>
|
||||
</TYPE.mediumHeader>
|
||||
<CloseIcon onClick={onDismiss} />
|
||||
</RowBetween>
|
||||
</PaddedColumn>
|
||||
@@ -98,7 +101,7 @@ export function ImportList({ listURL, list, setModalView, onDismiss }: ImportPro
|
||||
</TYPE.body>
|
||||
<TextDot />
|
||||
<TYPE.main fontSize={'16px'} ml="6px">
|
||||
{list.tokens.length} tokens
|
||||
<Trans>{list.tokens.length} tokens</Trans>
|
||||
</TYPE.main>
|
||||
</RowFixed>
|
||||
<ExternalLink href={`https://tokenlists.org/token-list?url=${listURL}`}>
|
||||
@@ -114,18 +117,20 @@ export function ImportList({ listURL, list, setModalView, onDismiss }: ImportPro
|
||||
<AutoColumn justify="center" style={{ textAlign: 'center', gap: '16px', marginBottom: '12px' }}>
|
||||
<AlertTriangle stroke={theme.red1} size={32} />
|
||||
<TYPE.body fontWeight={500} fontSize={20} color={theme.red1}>
|
||||
Import at your own risk{' '}
|
||||
<Trans>Import at your own risk</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
|
||||
<AutoColumn style={{ textAlign: 'center', gap: '16px', marginBottom: '12px' }}>
|
||||
<TYPE.body fontWeight={500} color={theme.red1}>
|
||||
By adding this list you are implicitly trusting that the data is correct. Anyone can create a list,
|
||||
including creating fake versions of existing lists and lists that claim to represent projects that do
|
||||
not have one.
|
||||
<Trans>
|
||||
By adding this list you are implicitly trusting that the data is correct. Anyone can create a list,
|
||||
including creating fake versions of existing lists and lists that claim to represent projects that do
|
||||
not have one.
|
||||
</Trans>
|
||||
</TYPE.body>
|
||||
<TYPE.body fontWeight={600} color={theme.red1}>
|
||||
If you purchase a token from this list, you may not be able to sell it back.
|
||||
<Trans>If you purchase a token from this list, you may not be able to sell it back.</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
<AutoRow justify="center" style={{ cursor: 'pointer' }} onClick={() => setConfirmed(!confirmed)}>
|
||||
@@ -136,7 +141,7 @@ export function ImportList({ listURL, list, setModalView, onDismiss }: ImportPro
|
||||
onChange={() => setConfirmed(!confirmed)}
|
||||
/>
|
||||
<TYPE.body ml="10px" fontSize="16px" color={theme.red1} fontWeight={500}>
|
||||
I understand
|
||||
<Trans>I understand</Trans>
|
||||
</TYPE.body>
|
||||
</AutoRow>
|
||||
</Card>
|
||||
@@ -148,7 +153,7 @@ export function ImportList({ listURL, list, setModalView, onDismiss }: ImportPro
|
||||
padding="10px 1rem"
|
||||
onClick={handleAddList}
|
||||
>
|
||||
Import
|
||||
<Trans>Import</Trans>
|
||||
</ButtonPrimary>
|
||||
{addError ? (
|
||||
<TYPE.error title={addError} style={{ textOverflow: 'ellipsis', overflow: 'hidden' }} error>
|
||||
|
||||
@@ -11,6 +11,7 @@ import styled from 'styled-components/macro'
|
||||
import { useIsUserAddedToken, useIsTokenActive } from 'hooks/Tokens'
|
||||
import { CheckCircle } from 'react-feather'
|
||||
import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const TokenSection = styled.div<{ dim?: boolean }>`
|
||||
padding: 4px 20px;
|
||||
@@ -73,7 +74,7 @@ export default function ImportRow({
|
||||
{list && list.logoURI && (
|
||||
<RowFixed>
|
||||
<TYPE.small mr="4px" color={theme.text3}>
|
||||
via {list.name}
|
||||
<Trans>via {list.name} </Trans>
|
||||
</TYPE.small>
|
||||
<ListLogo logoURI={list.logoURI} size="12px" />
|
||||
</RowFixed>
|
||||
@@ -90,12 +91,14 @@ export default function ImportRow({
|
||||
showImportView()
|
||||
}}
|
||||
>
|
||||
Import
|
||||
<Trans>Import</Trans>
|
||||
</ButtonPrimary>
|
||||
) : (
|
||||
<RowFixed style={{ minWidth: 'fit-content' }}>
|
||||
<CheckIcon />
|
||||
<TYPE.main color={theme.green1}>Active</TYPE.main>
|
||||
<TYPE.main color={theme.green1}>
|
||||
<Trans>Active</Trans>
|
||||
</TYPE.main>
|
||||
</RowFixed>
|
||||
)}
|
||||
</TokenSection>
|
||||
|
||||
@@ -18,6 +18,7 @@ import { ExternalLink } from '../../theme/components'
|
||||
import ListLogo from 'components/ListLogo'
|
||||
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
|
||||
import { PaddedColumn } from './styleds'
|
||||
import { Plural, Trans } from '@lingui/macro'
|
||||
|
||||
const Wrapper = styled.div`
|
||||
position: relative;
|
||||
@@ -59,7 +60,9 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
|
||||
<PaddedColumn gap="14px" style={{ width: '100%', flex: '1 1' }}>
|
||||
<RowBetween>
|
||||
{onBack ? <ArrowLeft style={{ cursor: 'pointer' }} onClick={onBack} /> : <div />}
|
||||
<TYPE.mediumHeader>Import {tokens.length > 1 ? 'Tokens' : 'Token'}</TYPE.mediumHeader>
|
||||
<TYPE.mediumHeader>
|
||||
<Plural value={tokens.length} one="Import token" other="Import tokens" />
|
||||
</TYPE.mediumHeader>
|
||||
{onDismiss ? <CloseIcon onClick={onDismiss} /> : <div />}
|
||||
</RowBetween>
|
||||
</PaddedColumn>
|
||||
@@ -68,9 +71,10 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
|
||||
<AutoColumn justify="center" style={{ textAlign: 'center', gap: '16px', padding: '1rem' }}>
|
||||
<AlertCircle size={48} stroke={theme.text2} strokeWidth={1} />
|
||||
<TYPE.body fontWeight={400} fontSize={16}>
|
||||
{
|
||||
"This token doesn't appear on the active token list(s). Make sure this is the token that you want to trade."
|
||||
}
|
||||
<Trans>
|
||||
This token doesn't appear on the active token list(s). Make sure this is the token that you want to
|
||||
trade.
|
||||
</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
{tokens.map((token) => {
|
||||
@@ -101,7 +105,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
|
||||
<RowFixed>
|
||||
{list.logoURI && <ListLogo logoURI={list.logoURI} size="16px" />}
|
||||
<TYPE.small ml="6px" fontSize={14} color={theme.text3}>
|
||||
via {list.name} token list
|
||||
<Trans>via {list.name} token list</Trans>
|
||||
</TYPE.small>
|
||||
</RowFixed>
|
||||
) : (
|
||||
@@ -109,7 +113,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
|
||||
<RowFixed>
|
||||
<AlertCircle stroke={theme.red1} size="10px" />
|
||||
<TYPE.body color={theme.red1} ml="4px" fontSize="10px" fontWeight={500}>
|
||||
Unknown Source
|
||||
<Trans>Unknown Source</Trans>
|
||||
</TYPE.body>
|
||||
</RowFixed>
|
||||
</WarningWrapper>
|
||||
@@ -129,7 +133,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
|
||||
}}
|
||||
className=".token-dismiss-button"
|
||||
>
|
||||
Import
|
||||
<Trans>Import</Trans>
|
||||
</ButtonPrimary>
|
||||
</AutoColumn>
|
||||
</Wrapper>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React, { useState } from 'react'
|
||||
import { PaddedColumn, Separator } from './styleds'
|
||||
import { RowBetween } from 'components/Row'
|
||||
@@ -63,7 +64,7 @@ export default function Manage({
|
||||
<RowBetween>
|
||||
<ArrowLeft style={{ cursor: 'pointer' }} onClick={() => setModalView(CurrencyModalView.search)} />
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
Manage
|
||||
<Trans>Manage</Trans>
|
||||
</Text>
|
||||
<CloseIcon onClick={onDismiss} />
|
||||
</RowBetween>
|
||||
@@ -72,10 +73,10 @@ export default function Manage({
|
||||
<PaddedColumn style={{ paddingBottom: 0 }}>
|
||||
<ToggleWrapper>
|
||||
<ToggleOption onClick={() => setShowLists(!showLists)} active={showLists}>
|
||||
Lists
|
||||
<Trans>Lists</Trans>
|
||||
</ToggleOption>
|
||||
<ToggleOption onClick={() => setShowLists(!showLists)} active={!showLists}>
|
||||
Tokens
|
||||
<Trans>Tokens</Trans>
|
||||
</ToggleOption>
|
||||
</ToggleWrapper>
|
||||
</PaddedColumn>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import React, { memo, useCallback, useMemo, useRef, useState, useEffect } from 'react'
|
||||
import { Settings, CheckCircle } from 'react-feather'
|
||||
import ReactGA from 'react-ga'
|
||||
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
||||
import { usePopper } from 'react-popper'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import styled from 'styled-components/macro'
|
||||
import { useFetchListCallback } from '../../hooks/useFetchListCallback'
|
||||
import { useOnClickOutside } from '../../hooks/useOnClickOutside'
|
||||
import { TokenList } from '@uniswap/token-lists'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
|
||||
import useToggle from '../../hooks/useToggle'
|
||||
import { AppDispatch, AppState } from '../../state'
|
||||
import { acceptListUpdate, removeList, disableList, enableList } from '../../state/lists/actions'
|
||||
import { useIsListActive, useAllLists, useActiveListUrls } from '../../state/lists/hooks'
|
||||
import { ExternalLink, LinkStyledButton, TYPE, IconWrapper } from '../../theme'
|
||||
@@ -93,8 +93,8 @@ function listUrlRowHTMLId(listUrl: string) {
|
||||
}
|
||||
|
||||
const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) {
|
||||
const listsByUrl = useSelector<AppState, AppState['lists']['byUrl']>((state) => state.lists.byUrl)
|
||||
const dispatch = useDispatch<AppDispatch>()
|
||||
const listsByUrl = useAppSelector((state) => state.lists.byUrl)
|
||||
const dispatch = useAppDispatch()
|
||||
const { current: list, pendingUpdate: pending } = listsByUrl[listUrl]
|
||||
|
||||
const theme = useTheme()
|
||||
@@ -173,7 +173,7 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) {
|
||||
</Row>
|
||||
<RowFixed mt="4px">
|
||||
<StyledListUrlText active={isActive} mr="6px">
|
||||
{list.tokens.length} tokens
|
||||
<Trans>{list.tokens.length} tokens</Trans>
|
||||
</StyledListUrlText>
|
||||
<StyledMenu ref={node as any}>
|
||||
<ButtonEmpty onClick={toggle} ref={setReferenceElement} padding="0">
|
||||
@@ -183,12 +183,16 @@ const ListRow = memo(function ListRow({ listUrl }: { listUrl: string }) {
|
||||
<PopoverContainer show={true} ref={setPopperElement as any} style={styles.popper} {...attributes.popper}>
|
||||
<div>{list && listVersionLabel(list.version)}</div>
|
||||
<SeparatorDark />
|
||||
<ExternalLink href={`https://tokenlists.org/token-list?url=${listUrl}`}>View list</ExternalLink>
|
||||
<ExternalLink href={`https://tokenlists.org/token-list?url=${listUrl}`}>
|
||||
<Trans>View list</Trans>
|
||||
</ExternalLink>
|
||||
<UnpaddedLinkStyledButton onClick={handleRemoveList} disabled={Object.keys(listsByUrl).length === 1}>
|
||||
Remove list
|
||||
<Trans>Remove list</Trans>
|
||||
</UnpaddedLinkStyledButton>
|
||||
{pending && (
|
||||
<UnpaddedLinkStyledButton onClick={handleAcceptListUpdate}>Update list</UnpaddedLinkStyledButton>
|
||||
<UnpaddedLinkStyledButton onClick={handleAcceptListUpdate}>
|
||||
<Trans>Update list</Trans>
|
||||
</UnpaddedLinkStyledButton>
|
||||
)}
|
||||
</PopoverContainer>
|
||||
)}
|
||||
@@ -287,14 +291,14 @@ export function ManageLists({
|
||||
async function fetchTempList() {
|
||||
fetchList(listUrlInput, false)
|
||||
.then((list) => setTempList(list))
|
||||
.catch(() => setAddError('Error importing list'))
|
||||
.catch(() => setAddError(t`Error importing list`))
|
||||
}
|
||||
// if valid url, fetch details for card
|
||||
if (validUrl) {
|
||||
fetchTempList()
|
||||
} else {
|
||||
setTempList(undefined)
|
||||
listUrlInput !== '' && setAddError('Enter valid list location')
|
||||
listUrlInput !== '' && setAddError(t`Enter valid list location`)
|
||||
}
|
||||
|
||||
// reset error
|
||||
@@ -321,7 +325,7 @@ export function ManageLists({
|
||||
<SearchInput
|
||||
type="text"
|
||||
id="list-add-input"
|
||||
placeholder="https:// or ipfs:// or ENS name"
|
||||
placeholder={t`https:// or ipfs:// or ENS name`}
|
||||
value={listUrlInput}
|
||||
onChange={handleInput}
|
||||
/>
|
||||
@@ -340,7 +344,9 @@ export function ManageLists({
|
||||
{tempList.logoURI && <ListLogo logoURI={tempList.logoURI} size="40px" />}
|
||||
<AutoColumn gap="4px" style={{ marginLeft: '20px' }}>
|
||||
<TYPE.body fontWeight={600}>{tempList.name}</TYPE.body>
|
||||
<TYPE.main fontSize={'12px'}>{tempList.tokens.length} tokens</TYPE.main>
|
||||
<TYPE.main fontSize={'12px'}>
|
||||
<Trans>{tempList.tokens.length} tokens</Trans>
|
||||
</TYPE.main>
|
||||
</AutoColumn>
|
||||
</RowFixed>
|
||||
{isImported ? (
|
||||
@@ -348,7 +354,9 @@ export function ManageLists({
|
||||
<IconWrapper stroke={theme.text2} size="16px" marginRight={'10px'}>
|
||||
<CheckCircle />
|
||||
</IconWrapper>
|
||||
<TYPE.body color={theme.text2}>Loaded</TYPE.body>
|
||||
<TYPE.body color={theme.text2}>
|
||||
<Trans>Loaded</Trans>
|
||||
</TYPE.body>
|
||||
</RowFixed>
|
||||
) : (
|
||||
<ButtonPrimary
|
||||
@@ -357,7 +365,7 @@ export function ManageLists({
|
||||
width="fit-content"
|
||||
onClick={handleImport}
|
||||
>
|
||||
Import
|
||||
<Trans>Import</Trans>
|
||||
</ButtonPrimary>
|
||||
)}
|
||||
</RowBetween>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { useActiveWeb3React } from 'hooks/web3'
|
||||
import Card from 'components/Card'
|
||||
import ImportRow from './ImportRow'
|
||||
import useTheme from '../../hooks/useTheme'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { CurrencyModalView } from './CurrencySearchModal'
|
||||
|
||||
@@ -109,7 +110,11 @@ export default function ManageTokens({
|
||||
onChange={handleInput}
|
||||
/>
|
||||
</Row>
|
||||
{searchQuery !== '' && !isAddressSearch && <TYPE.error error={true}>Enter valid token address</TYPE.error>}
|
||||
{searchQuery !== '' && !isAddressSearch && (
|
||||
<TYPE.error error={true}>
|
||||
<Trans>Enter valid token address</Trans>
|
||||
</TYPE.error>
|
||||
)}
|
||||
{searchToken && (
|
||||
<Card backgroundColor={theme.bg2} padding="10px 0">
|
||||
<ImportRow
|
||||
@@ -125,11 +130,13 @@ export default function ManageTokens({
|
||||
<PaddedColumn gap="lg" style={{ overflow: 'auto', marginBottom: '10px' }}>
|
||||
<RowBetween>
|
||||
<TYPE.main fontWeight={600}>
|
||||
{userAddedTokens?.length} Custom {userAddedTokens.length === 1 ? 'Token' : 'Tokens'}
|
||||
<Trans>{userAddedTokens?.length} Custom Tokens</Trans>
|
||||
</TYPE.main>
|
||||
{userAddedTokens.length > 0 && (
|
||||
<ButtonText onClick={handleRemoveAll}>
|
||||
<TYPE.blue>Clear all</TYPE.blue>
|
||||
<TYPE.blue>
|
||||
<Trans>Clear all</Trans>
|
||||
</TYPE.blue>
|
||||
</ButtonText>
|
||||
)}
|
||||
</RowBetween>
|
||||
@@ -137,7 +144,9 @@ export default function ManageTokens({
|
||||
</PaddedColumn>
|
||||
</Column>
|
||||
<Footer>
|
||||
<TYPE.darkGray>Tip: Custom tokens are stored locally in your browser</TYPE.darkGray>
|
||||
<TYPE.darkGray>
|
||||
<Trans>Tip: Custom tokens are stored locally in your browser</Trans>
|
||||
</TYPE.darkGray>
|
||||
</Footer>
|
||||
</Wrapper>
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
import React, { useContext, useRef, useState } from 'react'
|
||||
import { Settings, X } from 'react-feather'
|
||||
import ReactGA from 'react-ga'
|
||||
@@ -138,31 +139,34 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
|
||||
<RowBetween style={{ padding: '0 2rem' }}>
|
||||
<div />
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
Are you sure?
|
||||
<Trans>Are you sure?</Trans>
|
||||
</Text>
|
||||
<StyledCloseIcon onClick={() => setShowConfirmation(false)} />
|
||||
</RowBetween>
|
||||
<Break />
|
||||
<AutoColumn gap="lg" style={{ padding: '0 2rem' }}>
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result
|
||||
in bad rates and lost funds.
|
||||
<Trans>
|
||||
Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result
|
||||
in bad rates and lost funds.
|
||||
</Trans>
|
||||
</Text>
|
||||
<Text fontWeight={600} fontSize={20}>
|
||||
ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING.
|
||||
<Trans>ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING.</Trans>
|
||||
</Text>
|
||||
<ButtonError
|
||||
error={true}
|
||||
padding={'12px'}
|
||||
onClick={() => {
|
||||
if (window.prompt(`Please type the word "confirm" to enable expert mode.`) === 'confirm') {
|
||||
const confirmWord = t`confirm`
|
||||
if (window.prompt(t`Please type the word "${confirmWord}" to enable expert mode.`) === confirmWord) {
|
||||
toggleExpertMode()
|
||||
setShowConfirmation(false)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Text fontSize={20} fontWeight={500} id="confirm-expert-mode">
|
||||
Turn On Expert Mode
|
||||
<Trans>Turn On Expert Mode</Trans>
|
||||
</Text>
|
||||
</ButtonError>
|
||||
</AutoColumn>
|
||||
@@ -183,18 +187,22 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
|
||||
<MenuFlyout>
|
||||
<AutoColumn gap="md" style={{ padding: '1rem' }}>
|
||||
<Text fontWeight={600} fontSize={14}>
|
||||
Transaction Settings
|
||||
<Trans>Transaction Settings</Trans>
|
||||
</Text>
|
||||
<TransactionSettings placeholderSlippage={placeholderSlippage} />
|
||||
<Text fontWeight={600} fontSize={14}>
|
||||
Interface Settings
|
||||
<Trans>Interface Settings</Trans>
|
||||
</Text>
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
|
||||
Toggle Expert Mode
|
||||
<Trans>Toggle Expert Mode</Trans>
|
||||
</TYPE.black>
|
||||
<QuestionHelper text="Allow high price impact trades and skip the confirm screen. Use at your own risk." />
|
||||
<QuestionHelper
|
||||
text={
|
||||
<Trans>Allow high price impact trades and skip the confirm screen. Use at your own risk.</Trans>
|
||||
}
|
||||
/>
|
||||
</RowFixed>
|
||||
<Toggle
|
||||
id="toggle-expert-mode-button"
|
||||
@@ -215,9 +223,9 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
|
||||
Disable Multihops
|
||||
<Trans>Disable Multihops</Trans>
|
||||
</TYPE.black>
|
||||
<QuestionHelper text="Restricts swaps to direct pairs only." />
|
||||
<QuestionHelper text={<Trans>Restricts swaps to direct pairs only.</Trans>} />
|
||||
</RowFixed>
|
||||
<Toggle
|
||||
id="toggle-disable-multihop-button"
|
||||
|
||||
62
src/components/SwitchLocaleLink/index.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React, { useMemo } from 'react'
|
||||
import ReactGA from 'react-ga'
|
||||
import { useLocation } from 'react-router'
|
||||
import styled from 'styled-components/macro'
|
||||
import { DEFAULT_LOCALE, LOCALE_LABEL, SupportedLocale } from '../../constants/locales'
|
||||
import { navigatorLocale, useActiveLocale } from '../../hooks/useActiveLocale'
|
||||
import useParsedQueryString from '../../hooks/useParsedQueryString'
|
||||
import { StyledInternalLink, TYPE } from '../../theme'
|
||||
import { stringify } from 'qs'
|
||||
|
||||
const Container = styled(TYPE.small)`
|
||||
opacity: 0.6;
|
||||
:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
margin-top: 1rem !important;
|
||||
`
|
||||
|
||||
export function SwitchLocaleLink() {
|
||||
const activeLocale = useActiveLocale()
|
||||
const browserLocale = useMemo(() => navigatorLocale(), [])
|
||||
const location = useLocation()
|
||||
const qs = useParsedQueryString()
|
||||
|
||||
if (browserLocale && (browserLocale !== DEFAULT_LOCALE || activeLocale !== DEFAULT_LOCALE)) {
|
||||
let targetLocale: SupportedLocale
|
||||
if (activeLocale === browserLocale) {
|
||||
targetLocale = DEFAULT_LOCALE
|
||||
} else {
|
||||
targetLocale = browserLocale
|
||||
}
|
||||
|
||||
const target = {
|
||||
...location,
|
||||
search: stringify({ ...qs, lng: targetLocale }),
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Trans>
|
||||
Uniswap available in:{' '}
|
||||
{
|
||||
<StyledInternalLink
|
||||
onClick={() => {
|
||||
ReactGA.event({
|
||||
category: 'Localization',
|
||||
action: 'Switch Locale',
|
||||
label: `${activeLocale} -> ${targetLocale}`,
|
||||
})
|
||||
}}
|
||||
to={target}
|
||||
>
|
||||
{LOCALE_LABEL[targetLocale]}
|
||||
</StyledInternalLink>
|
||||
}
|
||||
</Trans>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import React from 'react'
|
||||
import Component from './index'
|
||||
|
||||
export default {
|
||||
title: 'ThemeColorPalette',
|
||||
}
|
||||
|
||||
const Template: Story<any> = (_args: any, context: Record<string, any>) => {
|
||||
const isDarkMode = context.globals.theme === 'dark'
|
||||
return <Component isDarkMode={isDarkMode} />
|
||||
}
|
||||
|
||||
export const Palette = Template.bind({})
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import { TYPE } from '../../theme'
|
||||
@@ -42,13 +43,13 @@ export default function ListToggle({ id, isActive, bgColor, toggle }: ToggleProp
|
||||
<Wrapper id={id} isActive={isActive} onClick={toggle}>
|
||||
{isActive && (
|
||||
<StatusText fontWeight="600" margin="0 6px" isActive={true}>
|
||||
ON
|
||||
<Trans>ON</Trans>
|
||||
</StatusText>
|
||||
)}
|
||||
<ToggleElement isActive={isActive} bgColor={bgColor} />
|
||||
{!isActive && (
|
||||
<StatusText fontWeight="600" margin="0 6px" isActive={false}>
|
||||
OFF
|
||||
<Trans>OFF</Trans>
|
||||
</StatusText>
|
||||
)}
|
||||
</Wrapper>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import { Story } from '@storybook/react/types-6-0'
|
||||
import styled from 'styled-components/macro'
|
||||
import React, { useState } from 'react'
|
||||
import MultiToggle from './MultiToggle'
|
||||
|
||||
const wrapperCss = styled.main`
|
||||
font-size: 2em;
|
||||
margin: 3em;
|
||||
max-width: 300px;
|
||||
`
|
||||
|
||||
export default {
|
||||
title: 'Toggles',
|
||||
argTypes: {
|
||||
width: { control: { type: 'string' } },
|
||||
},
|
||||
decorators: [
|
||||
(Component: Story) => (
|
||||
<div css={wrapperCss}>
|
||||
<Component />
|
||||
</div>
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
export const MultiToggleExample = () => {
|
||||
const [active, setActive] = useState(0)
|
||||
|
||||
function doSomethingWithIndex(index: number) {
|
||||
// here's where youd update state based on index choice
|
||||
// switch(index){} ...
|
||||
setActive(index)
|
||||
}
|
||||
return <MultiToggle toggle={doSomethingWithIndex} activeIndex={active} options={['option1', 'option2', 'option3']} />
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
|
||||
export const ToggleWrapper = styled.button<{ width?: string }>`
|
||||
@@ -31,32 +30,3 @@ export const ToggleElement = styled.span<{ isActive?: boolean; fontSize?: string
|
||||
color: ${({ theme, isActive }) => (isActive ? theme.text2 : theme.text3)};
|
||||
}
|
||||
`
|
||||
|
||||
export const ToggleText = styled.div`
|
||||
color: ${({ theme }) => theme.text3};
|
||||
font-size: 12px;
|
||||
margin-right: 0.5rem;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
padding: 0 0 0 4px;
|
||||
`
|
||||
|
||||
export interface ToggleProps {
|
||||
options: string[]
|
||||
activeIndex: number
|
||||
toggle: (index: number) => void
|
||||
id?: string
|
||||
width?: string
|
||||
}
|
||||
|
||||
export default function MultiToggle({ id, options, activeIndex, toggle, width }: ToggleProps) {
|
||||
return (
|
||||
<ToggleWrapper id={id} width={width}>
|
||||
{options.map((option, index) => (
|
||||
<ToggleElement key={id + '-' + index} isActive={index === activeIndex} onClick={() => toggle(index)}>
|
||||
{option}
|
||||
</ToggleElement>
|
||||
))}
|
||||
</ToggleWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
|
||||
@@ -44,10 +45,10 @@ export default function Toggle({ id, isActive, toggle }: ToggleProps) {
|
||||
return (
|
||||
<StyledToggle id={id} isActive={isActive} onClick={toggle}>
|
||||
<ToggleElement isActive={isActive} isOnSwitch={true}>
|
||||
On
|
||||
<Trans>On</Trans>
|
||||
</ToggleElement>
|
||||
<ToggleElement isActive={!isActive} isOnSwitch={false}>
|
||||
Off
|
||||
<Trans>Off</Trans>
|
||||
</ToggleElement>
|
||||
</StyledToggle>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import React, { ReactNode, useCallback, useState } from 'react'
|
||||
import styled from 'styled-components/macro'
|
||||
import Popover, { PopoverProps } from '../Popover'
|
||||
|
||||
@@ -10,11 +10,11 @@ const TooltipContainer = styled.div`
|
||||
`
|
||||
|
||||
interface TooltipProps extends Omit<PopoverProps, 'content'> {
|
||||
text: string
|
||||
text: ReactNode
|
||||
}
|
||||
|
||||
interface TooltipContentProps extends Omit<PopoverProps, 'content'> {
|
||||
content: React.ReactNode
|
||||
content: ReactNode
|
||||
}
|
||||
|
||||
export default function Tooltip({ text, ...rest }: TooltipProps) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Currency } from '@uniswap/sdk-core'
|
||||
import React, { useContext } from 'react'
|
||||
import React, { ReactNode, useContext } from 'react'
|
||||
import styled, { ThemeContext } from 'styled-components'
|
||||
import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink'
|
||||
import Modal from '../Modal'
|
||||
@@ -14,6 +14,7 @@ import Circle from '../../assets/images/blue-loader.svg'
|
||||
import MetaMaskLogo from '../../assets/images/metamask.png'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import useAddTokenToMetamask from 'hooks/useAddTokenToMetamask'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const Wrapper = styled.div`
|
||||
width: 100%;
|
||||
@@ -44,7 +45,7 @@ export function ConfirmationPendingContent({
|
||||
inline,
|
||||
}: {
|
||||
onDismiss: () => void
|
||||
pendingText: string
|
||||
pendingText: ReactNode
|
||||
inline?: boolean // not in modal
|
||||
}) {
|
||||
return (
|
||||
@@ -61,7 +62,7 @@ export function ConfirmationPendingContent({
|
||||
</ConfirmedIcon>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<Text fontWeight={500} fontSize={20} textAlign="center">
|
||||
Waiting For Confirmation
|
||||
<Trans>Waiting For Confirmation</Trans>
|
||||
</Text>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<Text fontWeight={600} fontSize={14} color="" textAlign="center">
|
||||
@@ -69,7 +70,7 @@ export function ConfirmationPendingContent({
|
||||
</Text>
|
||||
</AutoColumn>
|
||||
<Text fontSize={12} color="#565A69" textAlign="center" marginBottom={12}>
|
||||
Confirm this transaction in your wallet
|
||||
<Trans>Confirm this transaction in your wallet</Trans>
|
||||
</Text>
|
||||
</AutoColumn>
|
||||
</AutoColumn>
|
||||
@@ -110,12 +111,12 @@ export function TransactionSubmittedContent({
|
||||
</ConfirmedIcon>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<Text fontWeight={500} fontSize={20} textAlign="center">
|
||||
Transaction Submitted
|
||||
<Trans>Transaction Submitted</Trans>
|
||||
</Text>
|
||||
{chainId && hash && (
|
||||
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
|
||||
<Text fontWeight={500} fontSize={14} color={theme.primary1}>
|
||||
View on Etherscan
|
||||
<Trans>View on Explorer</Trans>
|
||||
</Text>
|
||||
</ExternalLink>
|
||||
)}
|
||||
@@ -123,11 +124,13 @@ export function TransactionSubmittedContent({
|
||||
<ButtonLight mt="12px" padding="6px 12px" width="fit-content" onClick={addToken}>
|
||||
{!success ? (
|
||||
<RowFixed>
|
||||
Add {currencyToAdd.symbol} to Metamask <StyledLogo src={MetaMaskLogo} />
|
||||
<Trans>
|
||||
Add {currencyToAdd.symbol} to Metamask <StyledLogo src={MetaMaskLogo} />
|
||||
</Trans>
|
||||
</RowFixed>
|
||||
) : (
|
||||
<RowFixed>
|
||||
Added {currencyToAdd.symbol}{' '}
|
||||
<Trans>Added {currencyToAdd.symbol} </Trans>
|
||||
<CheckCircle size={'16px'} stroke={theme.green1} style={{ marginLeft: '6px' }} />
|
||||
</RowFixed>
|
||||
)}
|
||||
@@ -135,7 +138,7 @@ export function TransactionSubmittedContent({
|
||||
)}
|
||||
<ButtonPrimary onClick={onDismiss} style={{ margin: '20px 0 0 0' }}>
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
{inline ? 'Return' : 'Close'}
|
||||
{inline ? <Trans>Return</Trans> : <Trans>Close</Trans>}
|
||||
</Text>
|
||||
</ButtonPrimary>
|
||||
</AutoColumn>
|
||||
@@ -150,10 +153,10 @@ export function ConfirmationModalContent({
|
||||
onDismiss,
|
||||
topContent,
|
||||
}: {
|
||||
title: string
|
||||
title: ReactNode
|
||||
onDismiss: () => void
|
||||
topContent: () => React.ReactNode
|
||||
bottomContent?: () => React.ReactNode | undefined
|
||||
topContent: () => ReactNode
|
||||
bottomContent?: () => ReactNode | undefined
|
||||
}) {
|
||||
return (
|
||||
<Wrapper>
|
||||
@@ -171,14 +174,14 @@ export function ConfirmationModalContent({
|
||||
)
|
||||
}
|
||||
|
||||
export function TransactionErrorContent({ message, onDismiss }: { message: string; onDismiss: () => void }) {
|
||||
export function TransactionErrorContent({ message, onDismiss }: { message: ReactNode; onDismiss: () => void }) {
|
||||
const theme = useContext(ThemeContext)
|
||||
return (
|
||||
<Wrapper>
|
||||
<Section>
|
||||
<RowBetween>
|
||||
<Text fontWeight={500} fontSize={20}>
|
||||
Error
|
||||
<Trans>Error</Trans>
|
||||
</Text>
|
||||
<CloseIcon onClick={onDismiss} />
|
||||
</RowBetween>
|
||||
@@ -195,7 +198,9 @@ export function TransactionErrorContent({ message, onDismiss }: { message: strin
|
||||
</AutoColumn>
|
||||
</Section>
|
||||
<BottomSection gap="12px">
|
||||
<ButtonPrimary onClick={onDismiss}>Dismiss</ButtonPrimary>
|
||||
<ButtonPrimary onClick={onDismiss}>
|
||||
<Trans>Dismiss</Trans>
|
||||
</ButtonPrimary>
|
||||
</BottomSection>
|
||||
</Wrapper>
|
||||
)
|
||||
@@ -205,9 +210,9 @@ interface ConfirmationModalProps {
|
||||
isOpen: boolean
|
||||
onDismiss: () => void
|
||||
hash: string | undefined
|
||||
content: () => React.ReactNode
|
||||
content: () => ReactNode
|
||||
attemptingTxn: boolean
|
||||
pendingText: string
|
||||
pendingText: ReactNode
|
||||
currencyToAdd?: Currency | undefined
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
import React, { useState, useContext } from 'react'
|
||||
import { Percent } from '@uniswap/sdk-core'
|
||||
import styled, { ThemeContext } from 'styled-components'
|
||||
@@ -155,9 +156,13 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
||||
<AutoColumn gap="sm">
|
||||
<RowFixed>
|
||||
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
|
||||
Slippage tolerance
|
||||
<Trans>Slippage tolerance</Trans>
|
||||
</TYPE.black>
|
||||
<QuestionHelper text="Your transaction will revert if the price changes unfavorably by more than this percentage." />
|
||||
<QuestionHelper
|
||||
text={
|
||||
<Trans>Your transaction will revert if the price changes unfavorably by more than this percentage.</Trans>
|
||||
}
|
||||
/>
|
||||
</RowFixed>
|
||||
<RowBetween>
|
||||
<Option
|
||||
@@ -166,7 +171,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
||||
}}
|
||||
active={userSlippageTolerance === 'auto'}
|
||||
>
|
||||
Auto
|
||||
<Trans>Auto</Trans>
|
||||
</Option>
|
||||
<OptionCustom active={userSlippageTolerance !== 'auto'} warning={!!slippageError} tabIndex={-1}>
|
||||
<RowBetween>
|
||||
@@ -205,11 +210,13 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
||||
color: slippageError ? 'red' : '#F3841E',
|
||||
}}
|
||||
>
|
||||
{slippageError
|
||||
? 'Enter a valid slippage percentage'
|
||||
: tooLow
|
||||
? 'Your transaction may fail'
|
||||
: 'Your transaction may be frontrun'}
|
||||
{slippageError ? (
|
||||
<Trans>Enter a valid slippage percentage</Trans>
|
||||
) : tooLow ? (
|
||||
<Trans>Your transaction may fail</Trans>
|
||||
) : (
|
||||
<Trans>Your transaction may be frontrun</Trans>
|
||||
)}
|
||||
</RowBetween>
|
||||
) : null}
|
||||
</AutoColumn>
|
||||
@@ -217,9 +224,9 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
||||
<AutoColumn gap="sm">
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={14} fontWeight={400} color={theme.text2}>
|
||||
Transaction deadline
|
||||
<Trans>Transaction deadline</Trans>
|
||||
</TYPE.black>
|
||||
<QuestionHelper text="Your transaction will revert if it is pending for more than this period of time." />
|
||||
<QuestionHelper text={t`Your transaction will revert if it is pending for more than this period of time.`} />
|
||||
</RowFixed>
|
||||
<RowFixed>
|
||||
<OptionCustom style={{ width: '80px' }} warning={!!deadlineError} tabIndex={-1}>
|
||||
@@ -241,7 +248,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
|
||||
/>
|
||||
</OptionCustom>
|
||||
<TYPE.body style={{ paddingLeft: '8px' }} fontSize={14}>
|
||||
minutes
|
||||
<Trans>minutes</Trans>
|
||||
</TYPE.body>
|
||||
</RowFixed>
|
||||
</AutoColumn>
|
||||
|
||||
@@ -6,6 +6,7 @@ import Option from './Option'
|
||||
import { injected } from '../../connectors'
|
||||
import { darken } from 'polished'
|
||||
import Loader from '../Loader'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const PendingSection = styled.div`
|
||||
${({ theme }) => theme.flexColumnNoWrap};
|
||||
@@ -82,20 +83,22 @@ export default function PendingView({
|
||||
<LoadingWrapper>
|
||||
{error ? (
|
||||
<ErrorGroup>
|
||||
<div>Error connecting.</div>
|
||||
<div>
|
||||
<Trans>Error connecting</Trans>
|
||||
</div>
|
||||
<ErrorButton
|
||||
onClick={() => {
|
||||
setPendingError(false)
|
||||
connector && tryActivation(connector)
|
||||
}}
|
||||
>
|
||||
Try Again
|
||||
<Trans>Try Again</Trans>
|
||||
</ErrorButton>
|
||||
</ErrorGroup>
|
||||
) : (
|
||||
<>
|
||||
<StyledLoader />
|
||||
Initializing...
|
||||
<Trans>Initializing...</Trans>
|
||||
</>
|
||||
)}
|
||||
</LoadingWrapper>
|
||||
|
||||
@@ -16,6 +16,7 @@ import { ApplicationModal } from '../../state/application/actions'
|
||||
import { useModalOpen, useWalletModalToggle } from '../../state/application/hooks'
|
||||
import { ExternalLink, TYPE } from '../../theme'
|
||||
import AccountDetails from '../AccountDetails'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import Modal from '../Modal'
|
||||
import Option from './Option'
|
||||
@@ -239,7 +240,7 @@ export default function WalletModal({
|
||||
id={`connect-${key}`}
|
||||
key={key}
|
||||
color={'#E8831D'}
|
||||
header={'Install Metamask'}
|
||||
header={<Trans>Install Metamask</Trans>}
|
||||
subheader={null}
|
||||
link={'https://metamask.io/'}
|
||||
icon={MetamaskIcon}
|
||||
@@ -290,12 +291,16 @@ export default function WalletModal({
|
||||
<CloseIcon onClick={toggleWalletModal}>
|
||||
<CloseColor />
|
||||
</CloseIcon>
|
||||
<HeaderRow>{error instanceof UnsupportedChainIdError ? 'Wrong Network' : 'Error connecting'}</HeaderRow>
|
||||
<HeaderRow>
|
||||
{error instanceof UnsupportedChainIdError ? <Trans>Wrong Network</Trans> : <Trans>Error connecting</Trans>}
|
||||
</HeaderRow>
|
||||
<ContentWrapper>
|
||||
{error instanceof UnsupportedChainIdError ? (
|
||||
<h5>Please connect to the appropriate Ethereum network.</h5>
|
||||
<h5>
|
||||
<Trans>Please connect to the appropriate Ethereum network.</Trans>
|
||||
</h5>
|
||||
) : (
|
||||
'Error connecting. Try refreshing the page.'
|
||||
<Trans>Error connecting. Try refreshing the page.</Trans>
|
||||
)}
|
||||
</ContentWrapper>
|
||||
</UpperSection>
|
||||
@@ -325,12 +330,14 @@ export default function WalletModal({
|
||||
setWalletView(WALLET_VIEWS.ACCOUNT)
|
||||
}}
|
||||
>
|
||||
Back
|
||||
<Trans>Back</Trans>
|
||||
</HoverText>
|
||||
</HeaderRow>
|
||||
) : (
|
||||
<HeaderRow>
|
||||
<HoverText>Connect to a wallet</HoverText>
|
||||
<HoverText>
|
||||
<Trans>Connect to a wallet</Trans>
|
||||
</HoverText>
|
||||
</HeaderRow>
|
||||
)}
|
||||
|
||||
@@ -338,10 +345,12 @@ export default function WalletModal({
|
||||
<LightCard style={{ marginBottom: '16px' }}>
|
||||
<AutoRow style={{ flexWrap: 'nowrap' }}>
|
||||
<TYPE.main fontSize={14}>
|
||||
By connecting a wallet, you agree to Uniswap Labs’{' '}
|
||||
<ExternalLink href="https://uniswap.org/terms-of-service/">Terms of Service</ExternalLink> and
|
||||
acknowledge that you have read and understand the{' '}
|
||||
<ExternalLink href="https://uniswap.org/disclaimer/">Uniswap protocol disclaimer</ExternalLink>.
|
||||
<Trans>
|
||||
By connecting a wallet, you agree to Uniswap Labs’{' '}
|
||||
<ExternalLink href="https://uniswap.org/terms-of-service/">Terms of Service</ExternalLink> and
|
||||
acknowledge that you have read and understand the{' '}
|
||||
<ExternalLink href="https://uniswap.org/disclaimer/">Uniswap protocol disclaimer</ExternalLink>.
|
||||
</Trans>
|
||||
</TYPE.main>
|
||||
</AutoRow>
|
||||
</LightCard>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useWeb3React } from '@web3-react/core'
|
||||
import styled from 'styled-components/macro'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import { network } from '../../connectors'
|
||||
import { useEagerConnect, useInactiveListener } from '../../hooks/web3'
|
||||
@@ -20,7 +20,6 @@ const Message = styled.h2`
|
||||
`
|
||||
|
||||
export default function Web3ReactManager({ children }: { children: JSX.Element }) {
|
||||
const { t } = useTranslation()
|
||||
const { active } = useWeb3React()
|
||||
const { active: networkActive, error: networkError, activate: activateNetwork } = useWeb3React(NetworkContextName)
|
||||
|
||||
@@ -58,7 +57,11 @@ export default function Web3ReactManager({ children }: { children: JSX.Element }
|
||||
if (!active && networkError) {
|
||||
return (
|
||||
<MessageWrapper>
|
||||
<Message>{t('unknownError')}</Message>
|
||||
<Message>
|
||||
<Trans>
|
||||
Oops! An unknown error occurred. Please refresh the page, or visit from another browser or device.
|
||||
</Trans>
|
||||
</Message>
|
||||
</MessageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { UnsupportedChainIdError, useWeb3React } from '@web3-react/core'
|
||||
import { darken, lighten } from 'polished'
|
||||
import React, { useMemo } from 'react'
|
||||
import { Activity } from 'react-feather'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
import styled, { css } from 'styled-components'
|
||||
import CoinbaseWalletIcon from '../../assets/images/coinbaseWalletIcon.svg'
|
||||
import FortmaticIcon from '../../assets/images/fortmaticIcon.png'
|
||||
@@ -123,11 +123,13 @@ function newTransactionsFirst(a: TransactionDetails, b: TransactionDetails) {
|
||||
return b.addedTime - a.addedTime
|
||||
}
|
||||
|
||||
const SOCK = (
|
||||
<span role="img" aria-label="has socks emoji" style={{ marginTop: -4, marginBottom: -4 }}>
|
||||
🧦
|
||||
</span>
|
||||
)
|
||||
function Sock() {
|
||||
return (
|
||||
<span role="img" aria-label={t`has socks emoji`} style={{ marginTop: -4, marginBottom: -4 }}>
|
||||
🧦
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/prop-types
|
||||
function StatusIcon({ connector }: { connector: AbstractConnector }) {
|
||||
@@ -136,25 +138,25 @@ function StatusIcon({ connector }: { connector: AbstractConnector }) {
|
||||
} else if (connector === walletconnect) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={WalletConnectIcon} alt={''} />
|
||||
<img src={WalletConnectIcon} alt={'WalletConnect'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === walletlink) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={CoinbaseWalletIcon} alt={''} />
|
||||
<img src={CoinbaseWalletIcon} alt={'CoinbaseWallet'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === fortmatic) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={FortmaticIcon} alt={''} />
|
||||
<img src={FortmaticIcon} alt={'Fortmatic'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
} else if (connector === portis) {
|
||||
return (
|
||||
<IconWrapper size={16}>
|
||||
<img src={PortisIcon} alt={''} />
|
||||
<img src={PortisIcon} alt={'Portis'} />
|
||||
</IconWrapper>
|
||||
)
|
||||
}
|
||||
@@ -162,7 +164,6 @@ function StatusIcon({ connector }: { connector: AbstractConnector }) {
|
||||
}
|
||||
|
||||
function Web3StatusInner() {
|
||||
const { t } = useTranslation()
|
||||
const { account, connector, error } = useWeb3React()
|
||||
|
||||
const { ENSName } = useENSName(account ?? undefined)
|
||||
@@ -185,11 +186,14 @@ function Web3StatusInner() {
|
||||
<Web3StatusConnected id="web3-status-connected" onClick={toggleWalletModal} pending={hasPendingTransactions}>
|
||||
{hasPendingTransactions ? (
|
||||
<RowBetween>
|
||||
<Text>{pending?.length} Pending</Text> <Loader stroke="white" />
|
||||
<Text>
|
||||
<Trans>{pending?.length} Pending</Trans>
|
||||
</Text>{' '}
|
||||
<Loader stroke="white" />
|
||||
</RowBetween>
|
||||
) : (
|
||||
<>
|
||||
{hasSocks ? SOCK : null}
|
||||
{hasSocks ? <Sock /> : null}
|
||||
<Text>{ENSName || shortenAddress(account)}</Text>
|
||||
</>
|
||||
)}
|
||||
@@ -200,13 +204,15 @@ function Web3StatusInner() {
|
||||
return (
|
||||
<Web3StatusError onClick={toggleWalletModal}>
|
||||
<NetworkIcon />
|
||||
<Text>{error instanceof UnsupportedChainIdError ? 'Wrong Network' : 'Error'}</Text>
|
||||
<Text>{error instanceof UnsupportedChainIdError ? <Trans>Wrong Network</Trans> : <Trans>Error</Trans>}</Text>
|
||||
</Web3StatusError>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<Web3StatusConnect id="connect-wallet" onClick={toggleWalletModal} faded={!account}>
|
||||
<Text>{t('Connect to a wallet')}</Text>
|
||||
<Text>
|
||||
<Trans>Connect to a wallet</Trans>
|
||||
</Text>
|
||||
</Web3StatusConnect>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { CardNoise, CardBGImage, CardBGImageSmaller } from '../earn/styled'
|
||||
import { useIsTransactionPending } from '../../state/transactions/hooks'
|
||||
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
|
||||
import { shortenAddress } from '../../utils'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const ContentWrapper = styled(AutoColumn)`
|
||||
width: 100%;
|
||||
@@ -103,23 +104,29 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
|
||||
<CardNoise />
|
||||
<CardSection gap="md">
|
||||
<RowBetween>
|
||||
<TYPE.white fontWeight={500}>Claim UNI Token</TYPE.white>
|
||||
<TYPE.white fontWeight={500}>
|
||||
<Trans>Claim UNI Token</Trans>
|
||||
</TYPE.white>
|
||||
<CloseIcon onClick={wrappedOnDismiss} style={{ zIndex: 99 }} stroke="white" />
|
||||
</RowBetween>
|
||||
<TYPE.white fontWeight={700} fontSize={36}>
|
||||
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
|
||||
<Trans>{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI</Trans>
|
||||
</TYPE.white>
|
||||
</CardSection>
|
||||
<Break />
|
||||
</ModalUpper>
|
||||
<AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center">
|
||||
<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
|
||||
submission.
|
||||
<Trans>
|
||||
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>
|
||||
<AddressInputPanel value={typed} onChange={handleRecipientType} />
|
||||
{parsedAddress && !hasAvailableClaim && (
|
||||
<TYPE.error error={true}>Address has no available claim</TYPE.error>
|
||||
<TYPE.error error={true}>
|
||||
<Trans>Address has no available claim</Trans>
|
||||
</TYPE.error>
|
||||
)}
|
||||
<ButtonPrimary
|
||||
disabled={!isAddress(parsedAddress ?? '') || !hasAvailableClaim}
|
||||
@@ -129,7 +136,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
|
||||
mt="1rem"
|
||||
onClick={onClaim}
|
||||
>
|
||||
Claim UNI
|
||||
<Trans>Claim UNI</Trans>
|
||||
</ButtonPrimary>
|
||||
</AutoColumn>
|
||||
</ContentWrapper>
|
||||
@@ -146,22 +153,22 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
|
||||
{!claimConfirmed ? (
|
||||
<CustomLightSpinner src={Circle} alt="loader" size={'90px'} />
|
||||
) : (
|
||||
<UniTokenAnimated width="72px" src={tokenLogo} />
|
||||
<UniTokenAnimated width="72px" src={tokenLogo} alt="UNI logo" />
|
||||
)}
|
||||
</ConfirmedIcon>
|
||||
<AutoColumn gap="100px" justify={'center'}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.largeHeader fontWeight={600} color="black">
|
||||
{claimConfirmed ? 'Claimed' : 'Claiming'}
|
||||
{claimConfirmed ? <Trans>Claimed</Trans> : <Trans>Claiming</Trans>}
|
||||
</TYPE.largeHeader>
|
||||
{!claimConfirmed && (
|
||||
<Text fontSize={36} color={'#ff007a'} fontWeight={800}>
|
||||
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
|
||||
<Trans>{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI</Trans>
|
||||
</Text>
|
||||
)}
|
||||
{parsedAddress && (
|
||||
<TYPE.largeHeader fontWeight={600} color="black">
|
||||
for {shortenAddress(parsedAddress)}
|
||||
<Trans>for {shortenAddress(parsedAddress)}</Trans>
|
||||
</TYPE.largeHeader>
|
||||
)}
|
||||
</AutoColumn>
|
||||
@@ -171,7 +178,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉{' '}
|
||||
</span>
|
||||
Welcome to team Unicorn :){' '}
|
||||
<Trans>Welcome to team Unicorn :) </Trans>
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉
|
||||
</span>
|
||||
@@ -179,11 +186,13 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
|
||||
</>
|
||||
)}
|
||||
{attempting && !hash && (
|
||||
<TYPE.subHeader color="black">Confirm this transaction in your wallet</TYPE.subHeader>
|
||||
<TYPE.subHeader color="black">
|
||||
<Trans>Confirm this transaction in your wallet</Trans>
|
||||
</TYPE.subHeader>
|
||||
)}
|
||||
{attempting && hash && !claimConfirmed && chainId && hash && (
|
||||
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ zIndex: 99 }}>
|
||||
View transaction on Etherscan
|
||||
<Trans>View transaction on Explorer</Trans>
|
||||
</ExternalLink>
|
||||
)}
|
||||
</AutoColumn>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { ButtonPrimary } from '../Button'
|
||||
import { AutoColumn, ColumnCenter } from '../Column'
|
||||
import Confetti from '../Confetti'
|
||||
import { Break, CardBGImage, CardBGImageSmaller, CardNoise, CardSection, DataCard } from '../earn/styled'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
import Modal from '../Modal'
|
||||
import { RowBetween } from '../Row'
|
||||
@@ -99,11 +100,13 @@ export default function ClaimModal() {
|
||||
<CardNoise />
|
||||
<CardSection gap="md">
|
||||
<RowBetween>
|
||||
<TYPE.white fontWeight={500}>Claim UNI</TYPE.white>
|
||||
<TYPE.white fontWeight={500}>
|
||||
<Trans>Claim UNI</Trans>
|
||||
</TYPE.white>
|
||||
<CloseIcon onClick={toggleClaimModal} style={{ zIndex: 99 }} color="white" />
|
||||
</RowBetween>
|
||||
<TYPE.white fontWeight={700} fontSize={36}>
|
||||
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
|
||||
<Trans>{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI</Trans>
|
||||
</TYPE.white>
|
||||
</CardSection>
|
||||
<Break />
|
||||
@@ -111,34 +114,48 @@ export default function ClaimModal() {
|
||||
{userClaimData?.flags?.isSOCKS && (
|
||||
<RowBetween>
|
||||
<TYPE.subHeader color="white">SOCKS</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">{SOCKS_AMOUNT} UNI</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">
|
||||
<Trans>{SOCKS_AMOUNT} UNI</Trans>
|
||||
</TYPE.subHeader>
|
||||
</RowBetween>
|
||||
)}
|
||||
{userClaimData?.flags?.isLP &&
|
||||
unclaimedAmount &&
|
||||
JSBI.greaterThanOrEqual(unclaimedAmount.quotient, nonLPAmount) && (
|
||||
<RowBetween>
|
||||
<TYPE.subHeader color="white">Liquidity</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">
|
||||
{unclaimedAmount
|
||||
.subtract(CurrencyAmount.fromRawAmount(unclaimedAmount.currency, nonLPAmount))
|
||||
.toFixed(0, { groupSeparator: ',' })}{' '}
|
||||
UNI
|
||||
<Trans>Liquidity</Trans>
|
||||
</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">
|
||||
<Trans>
|
||||
{unclaimedAmount
|
||||
.subtract(CurrencyAmount.fromRawAmount(unclaimedAmount.currency, nonLPAmount))
|
||||
.toFixed(0, { groupSeparator: ',' })}{' '}
|
||||
UNI
|
||||
</Trans>
|
||||
</TYPE.subHeader>
|
||||
</RowBetween>
|
||||
)}
|
||||
{userClaimData?.flags?.isUser && (
|
||||
<RowBetween>
|
||||
<TYPE.subHeader color="white">User</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">{USER_AMOUNT} UNI</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">
|
||||
<Trans>User</Trans>
|
||||
</TYPE.subHeader>
|
||||
<TYPE.subHeader color="white">
|
||||
<Trans>{USER_AMOUNT} UNI</Trans>
|
||||
</TYPE.subHeader>
|
||||
</RowBetween>
|
||||
)}
|
||||
</CardSection>
|
||||
</ModalUpper>
|
||||
<AutoColumn gap="md" style={{ padding: '1rem', paddingTop: '0' }} justify="center">
|
||||
<TYPE.subHeader fontWeight={500}>
|
||||
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>
|
||||
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>
|
||||
<ButtonPrimary
|
||||
disabled={!isAddress(account ?? '')}
|
||||
@@ -148,7 +165,7 @@ export default function ClaimModal() {
|
||||
mt="1rem"
|
||||
onClick={onClaim}
|
||||
>
|
||||
Claim UNI
|
||||
<Trans>Claim UNI</Trans>
|
||||
</ButtonPrimary>
|
||||
</AutoColumn>
|
||||
</ContentWrapper>
|
||||
@@ -165,7 +182,7 @@ export default function ClaimModal() {
|
||||
{!claimConfirmed ? (
|
||||
<CustomLightSpinner src={Circle} alt="loader" size={'90px'} />
|
||||
) : (
|
||||
<UniTokenAnimated width="72px" src={tokenLogo} />
|
||||
<UniTokenAnimated width="72px" src={tokenLogo} alt="UNI" />
|
||||
)}
|
||||
</ConfirmedIcon>
|
||||
<AutoColumn gap="100px" justify={'center'}>
|
||||
@@ -175,32 +192,36 @@ export default function ClaimModal() {
|
||||
</TYPE.largeHeader>
|
||||
{!claimConfirmed && (
|
||||
<Text fontSize={36} color={'#ff007a'} fontWeight={800}>
|
||||
{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI
|
||||
<Trans>{unclaimedAmount?.toFixed(0, { groupSeparator: ',' } ?? '-')} UNI</Trans>
|
||||
</Text>
|
||||
)}
|
||||
</AutoColumn>
|
||||
{claimConfirmed && (
|
||||
<>
|
||||
<TYPE.subHeader fontWeight={500} color="black">
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉{' '}
|
||||
</span>
|
||||
Welcome to team Unicorn :){' '}
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉
|
||||
</span>
|
||||
<Trans>
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉{' '}
|
||||
</span>
|
||||
Welcome to team Unicorn :){' '}
|
||||
<span role="img" aria-label="party-hat">
|
||||
🎉
|
||||
</span>
|
||||
</Trans>
|
||||
</TYPE.subHeader>
|
||||
</>
|
||||
)}
|
||||
{attempting && !claimSubmitted && (
|
||||
<TYPE.subHeader color="black">Confirm this transaction in your wallet</TYPE.subHeader>
|
||||
<TYPE.subHeader color="black">
|
||||
<Trans>Confirm this transaction in your wallet</Trans>
|
||||
</TYPE.subHeader>
|
||||
)}
|
||||
{attempting && claimSubmitted && !claimConfirmed && chainId && claimTxn?.hash && (
|
||||
<ExternalLink
|
||||
href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)}
|
||||
style={{ zIndex: 99 }}
|
||||
>
|
||||
View transaction on Etherscan
|
||||
<Trans>View transaction on Explorer</Trans>
|
||||
</ExternalLink>
|
||||
)}
|
||||
</AutoColumn>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { SubmittedView, LoadingView } from '../ModalViews'
|
||||
import { TransactionResponse } from '@ethersproject/providers'
|
||||
import { useTransactionAdder } from '../../state/transactions/hooks'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
|
||||
const ContentWrapper = styled(AutoColumn)`
|
||||
width: 100%;
|
||||
@@ -45,9 +46,7 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
|
||||
await stakingContract
|
||||
.getReward({ gasLimit: 350000 })
|
||||
.then((response: TransactionResponse) => {
|
||||
addTransaction(response, {
|
||||
summary: `Claim accumulated UNI rewards`,
|
||||
})
|
||||
addTransaction(response, { summary: t`Claim accumulated UNI rewards` })
|
||||
setHash(response.hash)
|
||||
})
|
||||
.catch((error: any) => {
|
||||
@@ -59,10 +58,10 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
|
||||
|
||||
let error: string | undefined
|
||||
if (!account) {
|
||||
error = 'Connect Wallet'
|
||||
error = t`Connect wallet`
|
||||
}
|
||||
if (!stakingInfo?.stakedAmount) {
|
||||
error = error ?? 'Enter an amount'
|
||||
error = error ?? t`Enter an amount`
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -70,7 +69,9 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
|
||||
{!attempting && !hash && (
|
||||
<ContentWrapper gap="lg">
|
||||
<RowBetween>
|
||||
<TYPE.mediumHeader>Claim</TYPE.mediumHeader>
|
||||
<TYPE.mediumHeader>
|
||||
<Trans>Claim</Trans>
|
||||
</TYPE.mediumHeader>
|
||||
<CloseIcon onClick={wrappedOnDismiss} />
|
||||
</RowBetween>
|
||||
{stakingInfo?.earnedAmount && (
|
||||
@@ -78,29 +79,37 @@ export default function ClaimRewardModal({ isOpen, onDismiss, stakingInfo }: Sta
|
||||
<TYPE.body fontWeight={600} fontSize={36}>
|
||||
{stakingInfo?.earnedAmount?.toSignificant(6)}
|
||||
</TYPE.body>
|
||||
<TYPE.body>Unclaimed UNI</TYPE.body>
|
||||
<TYPE.body>
|
||||
<Trans>Unclaimed UNI</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
)}
|
||||
<TYPE.subHeader style={{ textAlign: 'center' }}>
|
||||
When you claim without withdrawing your liquidity remains in the mining pool.
|
||||
<Trans>When you claim without withdrawing your liquidity remains in the mining pool.</Trans>
|
||||
</TYPE.subHeader>
|
||||
<ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onClaimReward}>
|
||||
{error ?? 'Claim'}
|
||||
{error ?? <Trans>Claim</Trans>}
|
||||
</ButtonError>
|
||||
</ContentWrapper>
|
||||
)}
|
||||
{attempting && !hash && (
|
||||
<LoadingView onDismiss={wrappedOnDismiss}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.body fontSize={20}>Claiming {stakingInfo?.earnedAmount?.toSignificant(6)} UNI</TYPE.body>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Claiming {stakingInfo?.earnedAmount?.toSignificant(6)} UNI</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</LoadingView>
|
||||
)}
|
||||
{hash && (
|
||||
<SubmittedView onDismiss={wrappedOnDismiss} hash={hash}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>Claimed UNI!</TYPE.body>
|
||||
<TYPE.largeHeader>
|
||||
<Trans>Transaction Submitted</Trans>
|
||||
</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Claimed UNI!</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</SubmittedView>
|
||||
)}
|
||||
|
||||
@@ -16,6 +16,7 @@ import { useTotalSupply } from '../../hooks/useTotalSupply'
|
||||
import { useV2Pair } from '../../hooks/useV2Pairs'
|
||||
import useUSDCPrice from '../../hooks/useUSDCPrice'
|
||||
import { BIG_INT_SECONDS_IN_WEEK } from '../../constants/misc'
|
||||
import { Trans } from '@lingui/macro'
|
||||
|
||||
const StatContainer = styled.div`
|
||||
display: flex;
|
||||
@@ -120,30 +121,41 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
|
||||
|
||||
<StyledInternalLink to={`/uni/${currencyId(currency0)}/${currencyId(currency1)}`} style={{ width: '100%' }}>
|
||||
<ButtonPrimary padding="8px" borderRadius="8px">
|
||||
{isStaking ? 'Manage' : 'Deposit'}
|
||||
{isStaking ? <Trans>Manage</Trans> : <Trans>Deposit</Trans>}
|
||||
</ButtonPrimary>
|
||||
</StyledInternalLink>
|
||||
</TopSection>
|
||||
|
||||
<StatContainer>
|
||||
<RowBetween>
|
||||
<TYPE.white> Total deposited</TYPE.white>
|
||||
<TYPE.white>
|
||||
{valueOfTotalStakedAmountInUSDC
|
||||
? `$${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}`
|
||||
: `${valueOfTotalStakedAmountInWETH?.toSignificant(4, { groupSeparator: ',' }) ?? '-'} ETH`}
|
||||
<Trans>Total deposited</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white>
|
||||
{valueOfTotalStakedAmountInUSDC ? (
|
||||
<Trans>${valueOfTotalStakedAmountInUSDC.toFixed(0, { groupSeparator: ',' })}</Trans>
|
||||
) : (
|
||||
<Trans>${valueOfTotalStakedAmountInWETH?.toSignificant(4, { groupSeparator: ',' }) ?? '-'} ETH</Trans>
|
||||
)}
|
||||
</TYPE.white>
|
||||
</RowBetween>
|
||||
<RowBetween>
|
||||
<TYPE.white> Pool rate </TYPE.white>
|
||||
<TYPE.white>
|
||||
{stakingInfo
|
||||
? stakingInfo.active
|
||||
? `${stakingInfo.totalRewardRate
|
||||
?.multiply(BIG_INT_SECONDS_IN_WEEK)
|
||||
?.toFixed(0, { groupSeparator: ',' })} UNI / week`
|
||||
: '0 UNI / week'
|
||||
: '-'}
|
||||
<Trans>Pool rate</Trans>
|
||||
</TYPE.white>
|
||||
<TYPE.white>
|
||||
{stakingInfo ? (
|
||||
stakingInfo.active ? (
|
||||
<Trans>
|
||||
{stakingInfo.totalRewardRate?.multiply(BIG_INT_SECONDS_IN_WEEK)?.toFixed(0, { groupSeparator: ',' })}{' '}
|
||||
UNI / week
|
||||
</Trans>
|
||||
) : (
|
||||
<Trans>0 UNI / week</Trans>
|
||||
)
|
||||
) : (
|
||||
'-'
|
||||
)}
|
||||
</TYPE.white>
|
||||
</RowBetween>
|
||||
</StatContainer>
|
||||
@@ -153,20 +165,29 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
|
||||
<Break />
|
||||
<BottomSection showBackground={true}>
|
||||
<TYPE.black color={'white'} fontWeight={500}>
|
||||
<span>Your rate</span>
|
||||
<span>
|
||||
<Trans>Your rate</Trans>
|
||||
</span>
|
||||
</TYPE.black>
|
||||
|
||||
<TYPE.black style={{ textAlign: 'right' }} color={'white'} fontWeight={500}>
|
||||
<span role="img" aria-label="wizard-icon" style={{ marginRight: '0.5rem' }}>
|
||||
⚡
|
||||
</span>
|
||||
{stakingInfo
|
||||
? stakingInfo.active
|
||||
? `${stakingInfo.rewardRate
|
||||
{stakingInfo ? (
|
||||
stakingInfo.active ? (
|
||||
<Trans>
|
||||
{stakingInfo.rewardRate
|
||||
?.multiply(BIG_INT_SECONDS_IN_WEEK)
|
||||
?.toSignificant(4, { groupSeparator: ',' })} UNI / week`
|
||||
: '0 UNI / week'
|
||||
: '-'}
|
||||
?.toSignificant(4, { groupSeparator: ',' })}{' '}
|
||||
UNI / week
|
||||
</Trans>
|
||||
) : (
|
||||
<Trans>0 UNI / week</Trans>
|
||||
)
|
||||
) : (
|
||||
'-'
|
||||
)}
|
||||
</TYPE.black>
|
||||
</BottomSection>
|
||||
</>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useState, useCallback } from 'react'
|
||||
import { useV2LiquidityTokenPermit } from '../../hooks/useERC20Permit'
|
||||
import useTransactionDeadline from '../../hooks/useTransactionDeadline'
|
||||
import { formatCurrencyAmount } from '../../utils/formatCurrencyAmount'
|
||||
import Modal from '../Modal'
|
||||
import { AutoColumn } from '../Column'
|
||||
import styled from 'styled-components/macro'
|
||||
@@ -19,6 +20,7 @@ import { StakingInfo, useDerivedStakeInfo } from '../../state/stake/hooks'
|
||||
import { TransactionResponse } from '@ethersproject/providers'
|
||||
import { useTransactionAdder } from '../../state/transactions/hooks'
|
||||
import { LoadingView, SubmittedView } from '../ModalViews'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
|
||||
const HypotheticalRewardRate = styled.div<{ dim: boolean }>`
|
||||
display: flex;
|
||||
@@ -103,7 +105,7 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
)
|
||||
.then((response: TransactionResponse) => {
|
||||
addTransaction(response, {
|
||||
summary: `Deposit liquidity`,
|
||||
summary: t`Deposit liquidity`,
|
||||
})
|
||||
setHash(response.hash)
|
||||
})
|
||||
@@ -153,7 +155,9 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
{!attempting && !hash && (
|
||||
<ContentWrapper gap="lg">
|
||||
<RowBetween>
|
||||
<TYPE.mediumHeader>Deposit</TYPE.mediumHeader>
|
||||
<TYPE.mediumHeader>
|
||||
<Trans>Deposit</Trans>
|
||||
</TYPE.mediumHeader>
|
||||
<CloseIcon onClick={wrappedOnDismiss} />
|
||||
</RowBetween>
|
||||
<CurrencyInputPanel
|
||||
@@ -164,18 +168,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
currency={stakingInfo.stakedAmount.currency}
|
||||
pair={dummyPair}
|
||||
label={''}
|
||||
customBalanceText={'Available to deposit: '}
|
||||
renderBalance={(amount) => <Trans>Available to deposit: {formatCurrencyAmount(amount, 4)}</Trans>}
|
||||
id="stake-liquidity-token"
|
||||
/>
|
||||
|
||||
<HypotheticalRewardRate dim={!hypotheticalRewardRate.greaterThan('0')}>
|
||||
<div>
|
||||
<TYPE.black fontWeight={600}>Weekly Rewards</TYPE.black>
|
||||
<TYPE.black fontWeight={600}>
|
||||
<Trans>Weekly Rewards</Trans>
|
||||
</TYPE.black>
|
||||
</div>
|
||||
|
||||
<TYPE.black>
|
||||
{hypotheticalRewardRate.multiply((60 * 60 * 24 * 7).toString()).toSignificant(4, { groupSeparator: ',' })}{' '}
|
||||
UNI / week
|
||||
<Trans>
|
||||
{hypotheticalRewardRate
|
||||
.multiply((60 * 60 * 24 * 7).toString())
|
||||
.toSignificant(4, { groupSeparator: ',' })}{' '}
|
||||
UNI / week
|
||||
</Trans>
|
||||
</TYPE.black>
|
||||
</HypotheticalRewardRate>
|
||||
|
||||
@@ -186,14 +196,14 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
confirmed={approval === ApprovalState.APPROVED || signatureData !== null}
|
||||
disabled={approval !== ApprovalState.NOT_APPROVED || signatureData !== null}
|
||||
>
|
||||
Approve
|
||||
<Trans>Approve</Trans>
|
||||
</ButtonConfirmed>
|
||||
<ButtonError
|
||||
disabled={!!error || (signatureData === null && approval !== ApprovalState.APPROVED)}
|
||||
error={!!error && !!parsedAmount}
|
||||
onClick={onStake}
|
||||
>
|
||||
{error ?? 'Deposit'}
|
||||
{error ?? <Trans>Deposit</Trans>}
|
||||
</ButtonError>
|
||||
</RowBetween>
|
||||
<ProgressCircles steps={[approval === ApprovalState.APPROVED || signatureData !== null]} disabled={true} />
|
||||
@@ -202,16 +212,24 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
{attempting && !hash && (
|
||||
<LoadingView onDismiss={wrappedOnDismiss}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.largeHeader>Depositing Liquidity</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>{parsedAmount?.toSignificant(4)} UNI-V2</TYPE.body>
|
||||
<TYPE.largeHeader>
|
||||
<Trans>Depositing Liquidity</Trans>
|
||||
</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>{parsedAmount?.toSignificant(4)} UNI-V2</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</LoadingView>
|
||||
)}
|
||||
{attempting && hash && (
|
||||
<SubmittedView onDismiss={wrappedOnDismiss} hash={hash}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>Deposited {parsedAmount?.toSignificant(4)} UNI-V2</TYPE.body>
|
||||
<TYPE.largeHeader>
|
||||
<Trans>Transaction Submitted</Trans>
|
||||
</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Deposited {parsedAmount?.toSignificant(4)} UNI-V2</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</SubmittedView>
|
||||
)}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { TransactionResponse } from '@ethersproject/providers'
|
||||
import { useTransactionAdder } from '../../state/transactions/hooks'
|
||||
import FormattedCurrencyAmount from '../FormattedCurrencyAmount'
|
||||
import { useActiveWeb3React } from '../../hooks/web3'
|
||||
import { t, Trans } from '@lingui/macro'
|
||||
|
||||
const ContentWrapper = styled(AutoColumn)`
|
||||
width: 100%;
|
||||
@@ -47,7 +48,7 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
|
||||
.exit({ gasLimit: 300000 })
|
||||
.then((response: TransactionResponse) => {
|
||||
addTransaction(response, {
|
||||
summary: `Withdraw deposited liquidity`,
|
||||
summary: t`Withdraw deposited liquidity`,
|
||||
})
|
||||
setHash(response.hash)
|
||||
})
|
||||
@@ -60,10 +61,10 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
|
||||
|
||||
let error: string | undefined
|
||||
if (!account) {
|
||||
error = 'Connect Wallet'
|
||||
error = t`Connect a wallet`
|
||||
}
|
||||
if (!stakingInfo?.stakedAmount) {
|
||||
error = error ?? 'Enter an amount'
|
||||
error = error ?? t`Enter an amount`
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -71,7 +72,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
|
||||
{!attempting && !hash && (
|
||||
<ContentWrapper gap="lg">
|
||||
<RowBetween>
|
||||
<TYPE.mediumHeader>Withdraw</TYPE.mediumHeader>
|
||||
<TYPE.mediumHeader>
|
||||
<Trans>Withdraw</Trans>
|
||||
</TYPE.mediumHeader>
|
||||
<CloseIcon onClick={wrappedOndismiss} />
|
||||
</RowBetween>
|
||||
{stakingInfo?.stakedAmount && (
|
||||
@@ -79,7 +82,9 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
|
||||
<TYPE.body fontWeight={600} fontSize={36}>
|
||||
{<FormattedCurrencyAmount currencyAmount={stakingInfo.stakedAmount} />}
|
||||
</TYPE.body>
|
||||
<TYPE.body>Deposited liquidity:</TYPE.body>
|
||||
<TYPE.body>
|
||||
<Trans>Deposited liquidity:</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
)}
|
||||
{stakingInfo?.earnedAmount && (
|
||||
@@ -87,31 +92,43 @@ export default function UnstakingModal({ isOpen, onDismiss, stakingInfo }: Staki
|
||||
<TYPE.body fontWeight={600} fontSize={36}>
|
||||
{<FormattedCurrencyAmount currencyAmount={stakingInfo?.earnedAmount} />}
|
||||
</TYPE.body>
|
||||
<TYPE.body>Unclaimed UNI</TYPE.body>
|
||||
<TYPE.body>
|
||||
<Trans>Unclaimed UNI</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
)}
|
||||
<TYPE.subHeader style={{ textAlign: 'center' }}>
|
||||
When you withdraw, your UNI is claimed and your liquidity is removed from the mining pool.
|
||||
<Trans>When you withdraw, your UNI is claimed and your liquidity is removed from the mining pool.</Trans>
|
||||
</TYPE.subHeader>
|
||||
<ButtonError disabled={!!error} error={!!error && !!stakingInfo?.stakedAmount} onClick={onWithdraw}>
|
||||
{error ?? 'Withdraw & Claim'}
|
||||
{error ?? <Trans>Withdraw & Claim</Trans>}
|
||||
</ButtonError>
|
||||
</ContentWrapper>
|
||||
)}
|
||||
{attempting && !hash && (
|
||||
<LoadingView onDismiss={wrappedOndismiss}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.body fontSize={20}>Withdrawing {stakingInfo?.stakedAmount?.toSignificant(4)} UNI-V2</TYPE.body>
|
||||
<TYPE.body fontSize={20}>Claiming {stakingInfo?.earnedAmount?.toSignificant(4)} UNI</TYPE.body>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Withdrawing {stakingInfo?.stakedAmount?.toSignificant(4)} UNI-V2</Trans>
|
||||
</TYPE.body>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Claiming {stakingInfo?.earnedAmount?.toSignificant(4)} UNI</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</LoadingView>
|
||||
)}
|
||||
{hash && (
|
||||
<SubmittedView onDismiss={wrappedOndismiss} hash={hash}>
|
||||
<AutoColumn gap="12px" justify={'center'}>
|
||||
<TYPE.largeHeader>Transaction Submitted</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>Withdrew UNI-V2!</TYPE.body>
|
||||
<TYPE.body fontSize={20}>Claimed UNI!</TYPE.body>
|
||||
<TYPE.largeHeader>
|
||||
<Trans>Transaction Submitted</Trans>
|
||||
</TYPE.largeHeader>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Withdrew UNI-V2!</Trans>
|
||||
</TYPE.body>
|
||||
<TYPE.body fontSize={20}>
|
||||
<Trans>Claimed UNI!</Trans>
|
||||
</TYPE.body>
|
||||
</AutoColumn>
|
||||
</SubmittedView>
|
||||
)}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Trans } from '@lingui/macro'
|
||||
import { Percent, Currency, TradeType } from '@uniswap/sdk-core'
|
||||
import { Trade as V2Trade } from '@uniswap/v2-sdk'
|
||||
import { Trade as V3Trade } from '@uniswap/v3-sdk'
|
||||
@@ -32,7 +33,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={12} fontWeight={400} color={theme.text2}>
|
||||
Liquidity Provider Fee
|
||||
<Trans>Liquidity Provider Fee</Trans>
|
||||
</TYPE.black>
|
||||
</RowFixed>
|
||||
<TYPE.black textAlign="right" fontSize={12} color={theme.text1}>
|
||||
@@ -43,7 +44,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={12} fontWeight={400} color={theme.text2}>
|
||||
Route
|
||||
<Trans>Route</Trans>
|
||||
</TYPE.black>
|
||||
</RowFixed>
|
||||
<TYPE.black textAlign="right" fontSize={12} color={theme.text1}>
|
||||
@@ -54,7 +55,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={12} fontWeight={400} color={theme.text2}>
|
||||
Price Impact
|
||||
<Trans>Price Impact</Trans>
|
||||
</TYPE.black>
|
||||
</RowFixed>
|
||||
<TYPE.black textAlign="right" fontSize={12} color={theme.text1}>
|
||||
@@ -65,7 +66,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={12} fontWeight={400} color={theme.text2}>
|
||||
{trade.tradeType === TradeType.EXACT_INPUT ? 'Minimum received' : 'Maximum sent'}
|
||||
{trade.tradeType === TradeType.EXACT_INPUT ? <Trans>Minimum received</Trans> : <Trans>Maximum sent</Trans>}
|
||||
</TYPE.black>
|
||||
</RowFixed>
|
||||
<TYPE.black textAlign="right" fontSize={12} color={theme.text1}>
|
||||
@@ -78,7 +79,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
|
||||
<RowBetween>
|
||||
<RowFixed>
|
||||
<TYPE.black fontSize={12} fontWeight={400} color={theme.text2}>
|
||||
Slippage tolerance
|
||||
<Trans>Slippage tolerance</Trans>
|
||||
</TYPE.black>
|
||||
</RowFixed>
|
||||
<TYPE.black textAlign="right" fontSize={12} color={theme.text1}>
|
||||
|
||||